Skip to content

Releases: urql-graphql/urql

v1.8.0

10 Jan 16:21
c380448
Compare
Choose a tag to compare

This release doesn't change any major feature aspects, but comes with bugfixes
to our suspense and concurrent-mode handling. Due to an upgrade to wonka@^4.0.0
this is a minor version though.

In v1.6.0 we believed to
have solved all issues related to suspense and concurrent mode. However there were
still some remaining cases where concurrent mode behaved incorrectly. With the new
useOperator hook in [email protected] we believe
to have now fixed all issues.

The initial mount of useQuery and useSubscription will now synchronously reflect
whatever urql returns, most of the times those will be cached results. Afterwards
all subsequent updates and fetches will be scheduled cooperatively with React on
an effect.

If you're using wonka for an exchange with urql you may want to upgrade to wonka@^4.0.5 soon.
You can still use the older v3.2.2 which will work with the new version (even in the same bundle),
unless you're making use of its subscribe, make, or makeSubject exports.
A migration guide can be found in the wonka docs.

v1.7.0

12 Dec 16:41
3329005
Compare
Choose a tag to compare

This release splits our main package into two entrypoints. Importing from urql remains
unchanged, but internally this entrypoint uses urql/core, which doesn't contain any
React-related code. If you're building framework-agnostic libraries or apps without
React, you can now use urql/core directly.

  • Fix originalError on GraphQLError instances (see #470)
  • Fix stringifyVariables not using .toJSON() which prevented Dates from being stringified, by @BjoernRave (see #485)
  • Expose urql/core without any React code included (see #424)

v1.6.3

11 Nov 18:41
58f0889
Compare
Choose a tag to compare
  • Fix suspense-mode being erroneously activated when using client.query() (see #466)

v1.6.2

05 Nov 18:13
65b5b7b
Compare
Choose a tag to compare

This fixes a potentially critical bug, where a component would enter an infinite rerender loop,
when another hook triggers an update. This may happen when multiple useQuery hooks are used in
a single component or when another state hook triggers a synchronous update.

  • Add generic type-parameter to client.query and client.mutation, by @ctrlplusb (see #456)
  • ⚠️ Fix useQuery entering an infinite loop during SSR when an update is triggered (see #459)

v1.6.1

12 Oct 19:53
059cb01
Compare
Choose a tag to compare
  • Fix hook updates not being propagated to potential context providers (see #451)

v1.6.0

11 Oct 16:51
3b4b518
Compare
Choose a tag to compare

This release comes with stability improvements for the useQuery and useSubscription hooks
when using suspense and concurrent mode. They should behave the same as before under normal
circumstances and continue to deliver the correct state on initial mount and updates.
The useQuery hook may however now trigger suspense updates when its inputs are changing,
as it should, instead of erroneously throwing a promise in useEffect.

The added stale: boolean flag on the hooks indicates whether a result is "stale".
useQuery will expose stale: true on results that are cached but will be updated
due to the use of cache-and-network.

We've also made some changes so that client.query() won't throw a promise, when suspense
mode is activated.

  • ✨ Add stale flag to OperationResult and hook results (see #449)
  • Replace useImmeditateEffect and useImmediateState with react-wonka derived state and effect (see #447)
  • Add (internal) suspense flag to OperationContext

v1.5.1

26 Sep 17:10
6e0e655
Compare
Choose a tag to compare
  • Replace fast-json-stable-stringify with embedded code (see #426)
  • ⚠ Prevent caching null data (see #437)

v1.5.0

06 Sep 15:35
850dca4
Compare
Choose a tag to compare

This release finally adds shortcuts to imperatively make queries and mutations.
They make it easier to quickly use the client programmatically, either with
a Wonka source-based or Promise-based call.

// Call .query or .mutation which return Source<OperationResult>
const source = client.query(doc, vars);
const source = client.mutation(doc, vars);
// Call .toPromise() on the source to get Promise<OperationResult>
const promise = client.query(doc, vars).toPromise();
const promise = client.mutation(doc, vars).toPromise();

This version also adds a useClient hook as a shortcut for useContext(Context).
We provide a default client that makes requests to /graphql. Since that has
confused users before, we now log a warning, when it's used.

  • ✨ Implement client.query() and client.mutation() (see #405)
  • Fix useImmediateEffect for concurrent mode (see #418)
  • Deconstruct Wonka.pipe using a Babel transform (see #419)
  • ⚠ Add useClient hook and warning when default client is used (see #420)

v1.4.1

02 Sep 11:28
02cac17
Compare
Choose a tag to compare

This release adds "active teardowns" for operations, which means that an exchange can now send a teardown to cancel ongoing operations. The subscriptionsExchange for instance now ends ongoing subscriptions proactively if the server says that they've completed! This is also reflected as fetching: false in the useQuery and useSubscription hook.

We've also fixed a small issue with suspense and added all features from useQuery to useSubscription! This includes the pause argument and an executeSubscription function.

  • ✨ Implement active teardowns and add missing features to useSubscription (see #410)
  • Fix UseMutationResponse TypeScript type, by @jbugman (see #412)
  • Exclude subscriptions from suspense source (see #415)

v1.4.0

21 Aug 15:52
af6eec7
Compare
Choose a tag to compare

This release removes all metadata for the @urql/devtools extension from the core
urql package. This data will now be generated internally in the devtools exchange
itself. Please also upgrade to the latest @urql/devtools version if you're using
the extension.

This release has mainly been focused on minor refactors to keep the bundlesize low.
But it also introduces new features, like specifying a default requestPolicy and
a new polling option on useQuery!

This release also exports makeResult and makeErrorResult, which will reduce the
boilerplate code that you need for custom fetch exchanges.

  • Minor bundlesize optimizations and remove debugExchange in production (see #375)
  • ✨ Add requestPolicy option to Client to change the default request policy (see #376)
  • ⚠ Remove dependency on graphql-tag and improve Operation.key hashing (see #383)
  • Remove networkLatency and source metadata from context, and delete useDevtoolsContext (see #387 and #388)
  • ✨ Add support for polling with pollInterval argument to useQuery, by @mxstbr (see #397)
  • ⚠ Prevent __typename from being added to the toplevel GraphQL documents (see #399)
  • Add operationName field to fetch request body (see #401)