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)
client.reexecuteOperation
calls. This would surface in asynchronous caching scenarios, where no result would be delivered by the cache synchronously, while it still calls client.reexecuteOperation
for e.g. a network-only
request, which happens for cache-and-network
. This issue becomes especially obvious in highly synchronous frameworks like Svelte, by @kitten (See #860)scheduleTask
polyfill with inline Promise.resolve().then(fn)
calls, by @kitten (See #861)Client
for withUrqlClient
even if the target component doesn't have a getInitialProps
method. Before this caused the client to not be initialised correctly on the client-side, by @JoviDeCroock (See #857)To migrate to the new version, you will now have to pass a single function argument, instead
of two arguments to the withUrqlClient
HOC helper. For instance, you would have to transform this:
export default withUrqlClient(
ctx => ({
url: '',
}),
ssrExchange => [dedupExchange, cacheExchange, ssrExchange, fetchExchange]
);
To look like the following:
export default withUrqlClient((ssrExchange, ctx) => ({
url: '',
exchanges: [dedupExchange, cacheExchange, ssrExchange, fetchExchange]
}), { ssr; true });
The second argument may now be used to pass { ssr: true }
explicitly, when you are
wrapping a page without another getInitialProps
method. This gives you better support
when you're implement custom methods like getStaticProps
.
getInitialProps
to be applied when the wrapped page getInitialProps
or when { ssr: true }
is passed as a second options object. This is to better support alternative methods like getStaticProps
. By @JoviDeCroock (See #797)withUrqlClient
function to remove the second argument formerly called mergeExchanges
and merges it with the first argument.As always, please ensure that you deduplicate @urql/core
when upgrading. Additionally
deduplicating the versions of wonka
that you have installed may also reduce your bundlesize.
client.subscription
shortcut method, similar to client.query
and client.mutation
, by @FredyC (See #838)This major release comes with a couple of fixes and new experimental offline support, which
we're very excited for! Please give it a try if your application is targeting Offline First!
To migrate to this new major version, check the major breaking changes below. Mainly you will have
to watch out for cache.invalidateQuery
which has been removed. Instead you should now invalidate
individual entities and fields using cache.invalidate
. Learn more about this method on our
docs.
populateExchange
export from @urql/exchange-graphcache
.populateExchange
, please install the seprate @urql/exchange-populate
package and import it from there, by @kitten (See #840)cache.invalidateQuery()
method has been removed. Please migrate over to cache.invalidate()
instead, which operates on individual fields instead of queries, by @kitten (See #840)opts
configuration to help spot typos.opts.keys
, opts.updates
, opts.resolvers
and opts.optimistic
. (See #820 and #826)persistedFetchExchange
to be an exchange factory. The persistedFetchExchange
nowpreferGetForPersistedQueries
, may nowClient
's preferGetMethod
false
.To migrate you will have to update your usage of persistedFetchExchange
from
import { persistedFetchExchange } from '@urql/exchange-persisted-fetch';
createClient({
exchanges: [
persistedFetchExchange
],
});
to the following:
import { persistedFetchExchange } from '@urql/exchange-persisted-fetch';
createClient({
exchanges: [
// Call the exchange and pass optional options:
persistedFetchExchange()
],
});
react-ssr-prepass
so it can get eliminated in the client-side bundle, this because the 1.2.1 version added "sideEffects:false", by @JoviDeCroock (See #809)source
debug name to all dispatchDebug
calls during build time to identify events by which exchange dispatched them, by @JoviDeCroock (See #780)