urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.

MIT License

Downloads
11.4M
Stars
8.5K
Committers
249

Bot releases are hidden (Show)

urql -

Published by kitten about 4 years ago

Minor Changes

  • Add the operation to the query, mutation and subscription result, by @JoviDeCroock (See #924)

Patch Changes

urql -

Published by kitten about 4 years ago

Minor Changes

  • Add the operation to the query, mutation and subscription result, by @JoviDeCroock (See #924)

Patch Changes

urql -

Published by kitten about 4 years ago

Minor Changes

  • Pass the parsed GraphQL-document as a second argument to the generateHash option, by @JoviDeCroock (See #887)
urql -

Published by kitten about 4 years ago

Patch Changes

  • Add special-case for fetching an introspection result in our schema-checking, this avoids an error when urql-devtools fetches the backend graphql schema, by @JoviDeCroock (See #893)
  • Mute warning when using built-in GraphQL fields, like __type, by @kitten (See #919)
  • ⚠️ Fix return type for resolvers to allow data objects to be returned with __typename as expected, by @JoviDeCroock (See #927)
  • Updated dependencies (See #911 and #908)
urql -

Published by kitten about 4 years ago

Patch Changes

  • Remove whitespace and comments from string-queries, by @JoviDeCroock (See #911)
  • Remove redundant whitespaces when using GET for graphql queries, by @JoviDeCroock (See #908)
urql -

Published by kitten about 4 years ago

Minor Changes

  • Add the option to reset the client on a next-urql application, by @JoviDeCroock (See #894)

Patch Changes

urql -

Published by kitten over 4 years ago

Minor Changes

  • Adds support for custom hash functions by adding a generateHash option to the exchange, by @lorenries (See #870)

Patch Changes

urql -

Published by kitten over 4 years ago

Patch Changes

  • ⚠️ Fix 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)
  • ⚠️ Fix ssrExchange invalidating results on the client-side too eagerly, by delaying invalidation by a tick, by @kitten (See #885)
urql -

Published by kitten over 4 years ago

Patch Changes

  • Disable suspense on the Client when we aren't using react-ssr-prepass, by @JoviDeCroock (See #884)
urql -

Published by kitten over 4 years ago

Minor Changes

  • Refactor all operations to allow for more use-cases which preserve state and allow all modes of Svelte to be applied to urql.
    // 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 });
    

Patch Changes

urql -

Published by kitten over 4 years ago

  • Add warning for queries that traverse an Operation Root Type (Mutation / Subscription types occuring in a query result), by @kitten (See #859)
  • ⚠️ Fix storage implementation not preserving deleted values correctly or erroneously checking optimistically written entries for changes. This is fixed by adding a new default serializer to the @urql/exchange-graphcache/default-storage implementation, which will be incompatible with the old one, by @kitten (See #866)
  • Replace unnecessary scheduleTask polyfill with inline Promise.resolve().then(fn) calls, by @kitten (See #861)
  • Updated dependencies (See #860 and #861)
urql -

Published by kitten over 4 years ago

Patch Changes

  • ⚠️ Fix timing for out-of-band 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)
  • Replace unnecessary scheduleTask polyfill with inline Promise.resolve().then(fn) calls, by @kitten (See #861)
urql -

Published by kitten over 4 years ago

Patch Changes

  • Prevent serialization of the 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)
urql -

Published by kitten over 4 years ago

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.

Major Changes

  • Change 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)
  • Update the withUrqlClient function to remove the second argument formerly called mergeExchanges and merges it with the first argument.

Patch Changes

urql -

Published by kitten over 4 years ago

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.

Minor Changes

  • Expose a client.subscription shortcut method, similar to client.query and client.mutation, by @FredyC (See #838)

Patch Changes

  • Upgrade to a minimum version of wonka@^4.0.14 to work around issues with React Native's minification builds, which use uglify-es and could lead to broken bundles, by @kitten (See #842)
urql -

Published by kitten over 4 years ago

Patch Changes

  • Upgrade to a minimum version of wonka@^4.0.14 to work around issues with React Native's minification builds, which use uglify-es and could lead to broken bundles, by @kitten (See #842)
  • Updated dependencies (See #838 and #842)
urql -

Published by kitten over 4 years ago

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.

Major Changes

  • Remove the deprecated populateExchange export from @urql/exchange-graphcache.
    If you're using the populateExchange, please install the seprate @urql/exchange-populate package and import it from there, by @kitten (See #840)
  • The deprecated 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)

Minor Changes

Patch Changes

  • ⚠️ Fix resolvers being executed for data even when data is currently written. This behaviour could lead to interference with custom updaters that update fragments or queries, e.g. an updater that was receiving paginated data due to a pagination resolver. We've determined that generally it is undesirable to have any resolvers run during the cache update (writing) process, since it may lead to resolver data being accidentally written to the cache or for resolvers to interfere with custom user updates, by @olistic (See #812)
  • Upgrade to a minimum version of wonka@^4.0.14 to work around issues with React Native's minification builds, which use uglify-es and could lead to broken bundles, by @kitten (See #842)
  • Updated dependencies (See #838 and #842)
urql -

Published by kitten over 4 years ago

Patch Changes

  • Upgrade to a minimum version of wonka@^4.0.14 to work around issues with React Native's minification builds, which use uglify-es and could lead to broken bundles, by @kitten (See #842)
  • Updated dependencies (See #838 and #842)
urql -

Published by kitten over 4 years ago

Patch Changes

  • Upgrade to a minimum version of wonka@^4.0.14 to work around issues with React Native's minification builds, which use uglify-es and could lead to broken bundles, by @kitten (See #842)
  • Updated dependencies (See #838 and #842)
urql -

Published by kitten over 4 years ago

Patch Changes

  • Upgrade to a minimum version of wonka@^4.0.14 to work around issues with React Native's minification builds, which use uglify-es and could lead to broken bundles, by @kitten (See #842)
  • Updated dependencies (See #838 and #842)