Releases: teamwalnut/rescript-urql
BuckleScript 7 Support
This release migrates our dependency on urql to v1.5.1. It also migrates our devDependency on bs-platform (the BuckleScript compiler), to v7.2.2. While we don't expect this to affect end users still on BuckleScript v6, there may be small bugfixes and optimizations coming in the near future to support this migration.
Added
- Add support for
Promise-based methodsqueryandmutationon the Client. This allows users to interact with Client operation results asJs.Promise.trather thanWonka.sourceT. PR by @parkerziegler here. - Add bindings for the
useClienthook. PR by @parkerziegler here.
Changed
- Migrate local
devDependencyonbs-platformto v7.2.2 and in-repo compilation target toes6. PR by @parkerziegler here. - Remove
peerDependencyonbs-fetch.
Diff
urql 1.4.0 Compatibility
This release migrates our dependency on urql to v1.4.0. This adds support for setting a default requestPolicy on the Client, in addition to setting up polling for your GraphQL queries using the pollInterval argument to useQuery and the Query component.
Added
- Add option to set a default
requestPolicyon the Client. PR by @JoviDeCroock here. - Add
pollIntervalargument touseQueryhook andQuerycomponent. PR by @JoviDeCroock here.
Diff
Extensions, Custom Fetch Implementation, Configurable Operation Contexts
This release migrates our dependency on urql to v1.3.0. As such, we now have support for GraphQL extensions, custom fetch implementations, and adjustable operation contexts for queries and mutations.
Added
- Access GraphQL extensions returned by your GraphQL API inside all hooks and componentts. PR by @parkerziegler here.
- Add support for a custom
fetchimplementation toclientOptions. Pr by @parkerziegler here. - Support an optional
contextargument toexecuteQueryandexecuteMutation, in addition to an optional initialcontextprop / argument for theQuerycomponent anduseQueryhook. PRs by @parkerziegler here and here.
Fixed
- Improved documentation on the
reason-urqlAPI. PR by @parkerziegler here.
v1.4.1
This release fixes a small bug with requestPolicy in useQuery. We weren't properly converting the polymorphic variants passed by a user to their JS string representation, which led to improper request policies being used by the urql Client.
Fixed
- Properly unwrap user-supplied
requestPolicyto the matching JS string representation. PR by @baransu here.
Diff
useDynamicMutation support!
This release adds support for a useDynamicMutation hook, which allows users to pass variables to the executeMutation function returned by the hook at execution time, as opposed to at render time as useMutation does.
Added
- Add
useDyanmicMutationhook to support applying variables when callingexecuteMutation. PR by @Schmavery and @sgrove here.
Fixed
- Restore CI by migrating off of GitHub Actions to Travis CI. PR by @parkerziegler here.
Diff
bs-platform 6 Support 🎉
This release migrates us to bs-platform@6.2.1 and ensures reason-urql is compatible for codebases using latest bs-platform.
Added
- Documentation on using
graphql_ppx_rewithreason-urql. PR by @huy-nguyen here. - Improved Getting Started documentation. PR by @parkerziegler here.
Changed
- Fix type for
pauseargument toQuerycomponent forbs-platform@6.2.1. PR by @gugahoa here. - Migrate to
bs-platform@6.2.1in source. Fix compiler warnings. RenamepartialOperationContextFntoexecuteQuery. This is a breaking change.
Diff
v1.2.0
This release upgrades our urql dependency to 1.2.0 and picks up a handful of small bugfixes introduced in that release.
Added
- The
operationContextobject now has ametaproperty on it, containing fields forsource,cacheOutcome, andnetworkLatency. These fields are likely to be deprecated in the next minor release and moved tobs-urql-devtools-exchange.
Changed
urqldependency upgraded to v1.2.0!bs-platformdependency upgraded to v5.2.1! PR by @parkerziegler here.- Some cmall changes to spurce up the example projects!
Diff
SSR ⚡
This release adds experimental support for server-side rendering with the addition of bindings for the ssrExchange.
Added
- Bindings for
ssrExchangeand thesuspenseoption on theClient.makefunction. PR by @parkerziegler here. - Initial docs for server side rendering support. PR by @parkerziegler here.
Changed
urqldependency upgraded to v1.1.3!
Fixed
- Minor docs fix by for the
Clientmodule. PR by @robinweser here. bsconfig.jsonandpackage.jsonfiles from theexamplesdirectory are no longer published tonpm.
Diff
v1.0.2
This release makes a small change around the API for CombinedError. Specifically, the module type t for CombinedError now refers to the record exposed by the module rather than the Js.t / OCaml class binding urql's native CombinedError class. Better documentation for CombinedError was also added.
Added
- More documentation on
CombinedErrorin the API docs. PR by @Schmavery and @parkerziegler here.
Changed
CombinedError.tnow references the record exposed by theCombinedErrormodule containing fields formessage,networkError,graphQLErrors, andmessage. PR by @Schmavery and @parkerziegler here.
Fixed
- Capitalization / casing for the
graphQLErrorsfield onCombinedError.t. Previously this was bound asgraphqlErrors, which would always result inNonebeing returned asurqlhas nographqlErrorsfield. PR by @Schmavery here.
Diff
v1.0.1
This release removes bs-fetch as a dependency such that it doesn't conflict with a user's local copy of bs-fetch. Since we only use bs-fetch for type checking fetchOptions, it can safely be included as a devDependency. This release also adds a message field on the combinedError record to provide users access to the raw error string from urql.
Removed
- Dependency on
bs-fetch.bs-fetchis now adevDependencyforreason-urqland can also be installed as apeerDependencyif you want to use a different version in your app. PR by @parkerziegler and @gugahoa here.
Added
messagefield onCombinedError.combinedError. This represents the raw stringmessagereturned by theurqlclient for your requests. PR by @Schmavery here.