All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
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.
- Add support for
Promise
-based methodsquery
andmutation
on the Client. This allows users to interact with Client operation results asJs.Promise.t
rather thanWonka.sourceT
. PR by @parkerziegler here. - Add bindings for the
useClient
hook. PR by @parkerziegler here.
- Migrate local
devDependency
onbs-platform
to v7.2.2 and in-repo compilation target toes6
. PR by @parkerziegler here. - Remove
peerDependency
onbs-fetch
.
https://github.com/FormidableLabs/reason-urql/compare/v1.6.0...v1.7.0
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.
- Add option to set a default
requestPolicy
on the Client. PR by @JoviDeCroock here. - Add
pollInterval
argument touseQuery
hook andQuery
component. PR by @JoviDeCroock here.
https://github.com/FormidableLabs/reason-urql/compare/v1.5.0...v1.6.0
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.
- Access GraphQL extensions returned by your GraphQL API inside all hooks and componentts. PR by @parkerziegler here.
- Add support for a custom
fetch
implementation toclientOptions
. Pr by @parkerziegler here. - Support an optional
context
argument toexecuteQuery
andexecuteMutation
, in addition to an optional initialcontext
prop / argument for theQuery
component anduseQuery
hook. PRs by @parkerziegler here and here.
- Improved documentation on the
reason-urql
API. PR by @parkerziegler here.
https://github.com/FormidableLabs/reason-urql/compare/v1.4.1...v1.5.0
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.
- Properly unwrap user-supplied
requestPolicy
to the matching JS string representation. PR by @baransu here.
https://github.com/FormidableLabs/reason-urql/compare/v1.4.0...v1.4.1
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.
- Add
useDyanmicMutation
hook to support applying variables when callingexecuteMutation
. PR by @Schmavery and @sgrove here.
- Restore CI by migrating off of GitHub Actions to Travis CI. PR by @parkerziegler here.
https://github.com/FormidableLabs/reason-urql/compare/v1.3.0...v1.4.0
This release migrates us to [email protected]
and ensures reason-urql
is compatible for codebases using latest bs-platform
.
- Documentation on using
graphql_ppx_re
withreason-urql
. PR by @huy-nguyen here. - Improved Getting Started documentation. PR by @parkerziegler here.
- Fix type for
pause
argument toQuery
component for[email protected]
. PR by @gugahoa here. - Migrate to
[email protected]
in source. Fix compiler warnings. RenamepartialOperationContextFn
toexecuteQuery
. This is a breaking change.
https://github.com/FormidableLabs/reason-urql/compare/v1.2.0...v1.3.0
This release upgrades our urql
dependency to 1.2.0 and picks up a handful of small bugfixes introduced in that release.
- The
operationContext
object now has ameta
property 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
.
urql
dependency upgraded to v1.2.0!bs-platform
dependency upgraded to v5.2.1! PR by @parkerziegler here.- Some cmall changes to spurce up the example projects!
https://github.com/FormidableLabs/reason-urql/compare/v1.1.0...v1.2.0
This release adds experimental support for server-side rendering with the addition of bindings for the ssrExchange
.
- Bindings for
ssrExchange
and thesuspense
option on theClient.make
function. PR by @parkerziegler here. - Initial docs for server side rendering support. PR by @parkerziegler here.
urql
dependency upgraded to v1.1.3!
- Minor docs fix by for the
Client
module. PR by @robinweser here. bsconfig.json
andpackage.json
files from theexamples
directory are no longer published tonpm
.
https://github.com/FormidableLabs/reason-urql/compare/v1.0.2...v1.1.0
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.
CombinedError.t
now references the record exposed by theCombinedError
module containing fields formessage
,networkError
,graphQLErrors
, andmessage
. PR by @Schmavery and @parkerziegler here.
- Capitalization / casing for the
graphQLErrors
field onCombinedError.t
. Previously this was bound asgraphqlErrors
, which would always result inNone
being returned asurql
has nographqlErrors
field. PR by @Schmavery here.
https://github.com/FormidableLabs/reason-urql/compare/v1.0.1...v1.0.2
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
.
- Dependency on
bs-fetch
.bs-fetch
is now adevDependency
forreason-urql
and can also be installed as apeerDependency
if you want to use a different version in your app. PR by @parkerziegler and @gugahoa here.
message
field onCombinedError.combinedError
. This represents the raw stringmessage
returned by theurql
client for your requests. PR by @Schmavery here.
https://github.com/FormidableLabs/reason-urql/compare/v1.0.0...v1.0.1
This release represents the first stable reason of reason-urql
. From this point forward we'll be starting to enforce semantic versioning for all changes. Thank you so much to all of the contributors who helped us to achieve this milestone!
- A Getting Started guide to help first time users of
reason-urql
get up and running.
- The
Error(e)
constructor of theresponse
variant has been moved above theData(d)
constructor to better matchurql
's JS API, where uses check for error responses on the GraphQL request before operating on data. - The
Types
andClient.Types
module
s were renamed toUrqlTypes
andClient.ClientTypes
to avoid namespace collisions with user-definedTypes
module
s.
https://github.com/FormidableLabs/reason-urql/compare/v1.0.0-beta.3...v1.0.0
This release adds improved type inference around the Client
's execute*
methods (i.e. executeQuery
, executeMutation
, and executeSubscription
). Responses will now be fully type checked at compile time. This release also pins the bound version of urql
to 1.0.5 to address a regression that occurs when using urql
> 1.2.0.
- Add proper type inference to
Client.execute*
methods. This now involves passing the fullgraphql_ppx
module to theClient
such that it can grab theparse
method off of it to properly infer the response. This mimics exactly how the components and hooks work. - Reorganize types to reduce redundancy and ensure unique generation of
[@bs.deriving abstract]
accessors. This change is mostly internal, but it begins to isolated types used by differentmodule
s into submodules. For example, rather than all types living in the top-levelTypes
module, certain types reserved for particular domains, i.e. theClient
, live in a submodule i.e.Client.Types
.
https://github.com/FormidableLabs/reason-urql/compare/v1.0.0-beta.2...v1.0.0-beta.3
This release adds small improvements around client.fetchOptions
and the CombinedError
API.
- The
FetchFn
variant of the client'sfetchOptions
argument now supports calling the function at runtime of the client rather than invoking it early in order to pass afetchOptions
object tourql
. UrqlCombinedError
is now properly bound using OCaml classes. A helper was added to convert theCombinedError
Js.t
to a record type to allow for nicer, typesafe access.
https://github.com/FormidableLabs/reason-urql/compare/v1.0.0-beta.1...v1.0.0-beta.2
This release includes support for urql
hooks, including useQuery
, useMutation
, and useSubscription
. It also includes additions to support proper type inference of GraphQL requests, such that users get compile-time guarantees that they are accessing data in a fully type-safe way.
- Bindings for
useQuery
,useMutation
, anduseSubscription
. - Bindings for
SubscriptionWithHandler
, which is to be used in cases where a customhandler
function is passed to theSubscription
component to accumulate subscriptions. - The top-level
urql
context object, which exposes aConsumer
andProvider
, is now exposed to the user.
- Migrated all components and examples to latest ReasonReact syntax (
"jsx: 3"
). - Add proper type inference for hooks and components. This is achieved by passing the entire
graphql_ppx
module to the hooks, which allows them to use theparse
method to infer the return type of data from the request.
https://github.com/parkerziegler/reason-urql/compare/v1.0.0-beta...v1.0.0-beta.1
This represents the beta release of v1, which provides support for urql
v1.
- Bindings for
Query
,Mutation
, andSubscription
components. - Bindings for
Client
with support for exchanges. - Bindings for
Provider
. - Bindings for
urql
's type interfaces, utils, and helpers. - Examples for
Query
,Mutation
,Subscription
, exposed exchanges, custom exchanges, and imperativeClient
methods. - First tests for
UrqlClient
.
https://github.com/parkerziegler/reason-urql/compare/v0.1.1...v1.0.0-beta
- Additional tests for
Query
,Mutation
,Connect
, andClient
.
- The
invalidate
cache operation supplied toConnect
now properly accepts a single, optional labelled argument~query: Query.urqlQuery
. This will now type check properly thanks to a final positionalunit
parameter in the type definition.
https://github.com/parkerziegler/reason-urql/compare/v0.1.0...v0.1.1
Welcome to v0.1.0 of reason-urql
. With this release, we are moving into a stable state and will continue onwards with standard semantic versioning.
- Automated builds with Travis CI.
- Automated coverage reporting with Coveralls.
- Unit tests for
UrqlQuery
,UrqlMutation
,UrqlConnect
,UrqlClient
, andUrqlProvider
. - Codified utilities for making tests more concise – see
TestUtils.re
. - Zero-config, hot reloading in the example project.
- Small, non-breaking changes to the API.
https://github.com/parkerziegler/reason-urql/compare/v0.1.0-beta...v0.1.0
This is the initial beta release of reason-urql! These bindings are currently untested and should not be used in production just yet. Come help us by writing tests, opening issues, and filing PRs. Thanks!