Releases: urql-graphql/urql
v1.8.1
This patch fixes urql
relying on a quirk in older versions of wonka
where
shared sources wouldn't cascade cancellations, which they now do. This meant
that when an app goes from some queries/subscriptions to having none at all,
the exchange pipeline would be stopped completely.
- Fix exchange pipeline stalling when all queries end (see #503)
v1.8.0
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.
- Support concurrent mode with all edge cases fully (see #496)
- Move to
[email protected]
with the prior fix in #496 (see #499)
v1.7.0
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
onGraphQLError
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
v1.6.2
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
andclient.mutation
, by @ctrlplusb (see #456) ⚠️ FixuseQuery
entering an infinite loop during SSR when an update is triggered (see #459)
v1.6.1
v1.6.0
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.
v1.5.1
v1.5.0
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.
v1.4.1
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.