The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
MIT License
Bot releases are visible (Hide)
Initial Release
We're very excited to provide an easy and unified approach to implement different authentication (and re-authentication strategies) with urql
! Please check @urql/exchange-auth
's README for more information how to use this new exchange: https://github.com/FormidableLabs/urql/blob/main/exchanges/auth/README.md
null
, by @jlengstorf (See #944)Content-Type: application/json
HTTP header when using GET in the fetchExchange
, persistedFetchExchange
, or multipartFetchExchange
, by @JoviDeCroock (See #957)Content-Type: application/json
HTTP header when using GET in the fetchExchange
, persistedFetchExchange
, or multipartFetchExchange
, by @JoviDeCroock (See #957)nodes
fields to the relayPagination
helper, instead of only supporting the standard edges
. (See #897)Please note that this release changes the data structure of the ssrExchange
's
output. We don't treat this as a breaking change, since this data is considered
a private structure, but if your tests or other code relies on this, please check
the type changes and update it.
ssrExchange
, for instance as a result of mutations by Graphcache. Instead the ssrExchange
now serializes data early, by @kitten (See #962)Content-Type: application/json
HTTP header when using GET in the fetchExchange
, persistedFetchExchange
, or multipartFetchExchange
, by @JoviDeCroock (See #957)generateHash
option, by @JoviDeCroock (See #887)__type
, by @kitten (See #919)__typename
as expected, by @JoviDeCroock (See #927)generateHash
option to the exchange, by @lorenries (See #870)formatDocument
mutating parts of the DocumentNode
which may be shared by other documents and queries. Also ensure that a formatted document will always generate the same key in createRequest
as the original document, by @kitten (See #880)ssrExchange
invalidating results on the client-side too eagerly, by delaying invalidation by a tick, by @kitten (See #885)Client
when we aren't using react-ssr-prepass
, by @JoviDeCroock (See #884)// Standard Usage:
mutate({ query, variables })()
// Subscribable Usage:
$: result = mutate({ query, variables });
// Curried Usage
const executeMutation = mutate({ query, variables });
const onClick = () => executeMutation();
// Curried Usage with overrides
const executeMutation = mutate({ query });
const onClick = () => await executeMutation({ variables });
// Subscribable Usage (as before):
$: result = query({ query: TestQuery, variables });
// Subscribable Usage which preserves state over time:
const testQuery = query({ query: TestQuery });
// - this preserves the state even when the variables change!
$: result = testQuery({ variables });
// Promise-based callback usage:
const testQuery = query({ query: TestQuery });
const doQuery = async () => await testQuery;
// Promise-based usage updates the subscribables!
const testQuery = query({ query: TestQuery });
const doQuery = async () => await testQuery;
// - doQuery will also update this result
$: result = query({ query: TestQuery, variables });
@urql/exchange-graphcache/default-storage
implementation, which will be incompatible with the old one, by @kitten (See #866)scheduleTask
polyfill with inline Promise.resolve().then(fn)
calls, by @kitten (See #861)