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 visible (Hide)

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • Allow mutations to update their results in bindings when hasNext: true is set, which indicates deferred or streamed results
    Submitted by @kitten (See #3103)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • Update exchanges to drop redundant share calls, since @urql/core’s composeExchanges utility now automatically does so for us
    Submitted by @kitten (See #3082)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Major Changes

  • Remove the default Client from Context. Previously, urql kept a legacy default client in its context, with default exchanges and calling an API at /graphql. This has now been removed and you will have to create your own Client if you were relying on this behaviour
    Submitted by @JoviDeCroock (See #3033)

Minor Changes

  • Allow mutations to update their results in bindings when hasNext: true is set, which indicates deferred or streamed results
    Submitted by @kitten (See #3103)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • Update exchanges to drop redundant share calls, since @urql/core’s composeExchanges utility now automatically does so for us
    Submitted by @kitten (See #3082)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • Add TSDocs to @urql/* packages
    Submitted by @kitten (See #3079)
urql - [email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • Update exchanges to drop redundant share calls, since @urql/core’s composeExchanges utility now automatically does so for us
    Submitted by @kitten (See #3082)

Patch Changes

urql - [email protected]

Published by github-actions[bot] over 1 year ago

Major Changes

  • Remove the default Client from Context. Previously, urql kept a legacy default client in its context, with default exchanges and calling an API at /graphql. This has now been removed and you will have to create your own Client if you were relying on this behaviour
    Submitted by @JoviDeCroock (See #3033)

Minor Changes

  • Allow mutations to update their results in bindings when hasNext: true is set, which indicates deferred or streamed results
    Submitted by @kitten (See #3103)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Major Changes

  • Update OperationResult.hasNext and OperationResult.stale to be required fields. If you have a custom exchange creating results, you'll have to add these fields or use the makeResult, mergeResultPatch, or makeErrorResult helpers
    Submitted by @kitten (See #3061)
  • Move handler, which combines subscription events, from mutationStore to subscriptionStore. It’s accidentally been defined and implemented on the wrong store and was meant to be on subscriptionStore
    Submitted by @kitten (See #3078)

Minor Changes

  • Allow mutations to update their results in bindings when hasNext: true is set, which indicates deferred or streamed results
    Submitted by @kitten (See #3103)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • Update exchanges to drop redundant share calls, since @urql/core’s composeExchanges utility now automatically does so for us
    Submitted by @kitten (See #3082)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Major Changes

  • Remove defaultExchanges from @urql/core and make exchanges a required property on Client construction.
    In doing so we make the urql package more tree-shakeable as the three default exchanges are in no code paths
    meaning they can be removed if not used.
    A migration would look as follows if you are currently creating a client without exchanges

    import { createClient, cacheExchange, fetchExchange } from '@urql/core';
    
    const client = createClient({
      url: '',
      exchanges: [cacheExchange, fetchExchange],
    });
    

    Submitted by @JoviDeCroock (See #3033)

  • Update subscriptionExchange to receive FetchBody instead. In the usual usage of subscriptionExchange (for instance with graphql-ws) you can expect no breaking changes. However, the key and extensions field has been removed and instead the forwardSubscription function receives the full Operation as a second argument
    Submitted by @kitten (See #3054)

  • Remove dependence on graphql package and replace it with @0no-co/graphql.web, which reduces the default bundlesize impact of urql packages to a minimum. All types should remain compatible, even if you use graphql elsewhere in your app, and if other dependencies are using graphql you may alias it to graphql-web-lite
    Submitted by @kitten (See #3097)

  • Update OperationResult.hasNext and OperationResult.stale to be required fields. If you have a custom exchange creating results, you'll have to add these fields or use the makeResult, mergeResultPatch, or makeErrorResult helpers
    Submitted by @kitten (See #3061)

  • Remove getOperationName export from @urql/core
    Submitted by @kitten (See #3062)

Minor Changes

  • Return a new OperationResultSource from all Client methods (which replaces PromisifiedSource on shortcut methods). This allows not only toPromise() to be called, but it can also be used as an awaitable PromiseLike and has a .subscribe(onResult) method aliasing the subscribe utility from wonka
    Submitted by @kitten (See #3060)
  • Update subscriptionExchange to support incremental results out of the box. If a subscription proactively completes, results are also now updated with hasNext: false
    Submitted by @kitten (See #3055)
  • Implement text/event-stream response support. This generally adheres to the GraphQL SSE protocol and GraphQL Yoga push responses, and is an alternative to multipart/mixed
    Submitted by @kitten (See #3050)
  • Implement GraphQL Multipart Request support in @urql/core. This adds the File/Blob upload support to @urql/core, which effectively deprecates @urql/exchange-multipart-fetch
    Submitted by @kitten (See #3051)
  • Support GraphQLRequest.extensions as spec-extensions input to GraphQL requests
    Submitted by @kitten (See #3054)
  • Allow subscriptions to be handled by the fetchExchange when fetchSubscriptions is turned on
    Submitted by @kitten (See #3106)
  • Deprecate the dedupExchange. The functionality of deduplicating queries and subscriptions has now been moved into and absorbed by the Client.
    Previously, the Client already started doing some work to share results between
    queries, and to avoid dispatching operations as needed. It now only dispatches operations
    strictly when the dedupExchange would allow so as well, moving its logic into the
    Client
    Submitted by @kitten (See #3058)

Patch Changes

  • Deduplicate operations as the dedupExchange did; by filtering out duplicate operations until either the original operation has been cancelled (teardown) or a first result (without hasNext: true) has come in
    Submitted by @kitten (See #3101)
  • ⚠️ Fix source maps included with recently published packages, which lost their sourcesContent, including additional source files, and had incorrect paths in some of them
    Submitted by @kitten (See #3053)
  • Allow makeOperation to be called with a partial OperationContext when it’s called to copy an operation. When it receives an Operation as a second argument now, the third argument, the context, will be spread into the prior operation.context
    Submitted by @kitten (See #3081)
  • Move multipart/mixed to end of Accept header to avoid cauing Yoga to unnecessarily use it
    Submitted by @JoviDeCroock (See #3039)
  • Upgrade to wonka@^6.3.0
    Submitted by @kitten (See #3104)
  • Update Exchange contract and composeExchanges utility to remove the need to manually call share on either incoming Source<Operation> or forward()’s Source<OperationResult>. This is now taken care of internally in composeExchanges and should make it easier for you to create custom exchanges and for us to explain them
    Submitted by @kitten (See #3082)
  • Add support for graphql’s built-in TypedQueryDocumentNode typings for type inference
    Submitted by @kitten (See #3085)
  • Add missing type exports of SSR-related types (SerializedResult, SSRExchangeParams, SSRExchange, and SSRData) to @urql/core's type exports
    Submitted by @kitten (See #3079)
  • Allow any object fitting the GraphQLError shape to rehydrate without passing through a GraphQLError constructor in CombinedError
    Submitted by @kitten (See #3087)
  • Add missing hasNext and stale passthroughs on caching exchanges
    Submitted by @kitten (See #3059)
  • ⚠️ Fix incremental results not merging errors from subsequent non-incremental results
    Submitted by @kitten (See #3055)
  • Add logic for request.extensions.persistedQuery to @urql/core to omit sending query as needed
    Submitted by @kitten (See #3057)
  • ⚠️ Fix incorrect operation name being picked from queries that contain multiple operations
    Submitted by @kitten (See #3062)
  • Replace fetch source implementation with async generator implementation, based on Wonka's fromAsyncIterable.
    This also further hardens our support for the "Incremental Delivery" specification and
    refactors its implementation and covers more edge cases
    Submitted by @kitten (See #3043)
  • Ensure network errors are always issued with CombinedErrors, while downstream errors are re-thrown
    Submitted by @kitten (See #3063)
  • Refactor Client result source construction code and allow multiple mutation
    results, if result.hasNext on a mutation result is set to true, indicating
    deferred or streamed results
    Submitted by @kitten (See #3102)
  • Remove dependence on import { visit } from 'graphql'; with smaller but functionally equivalent alternative
    Submitted by @kitten (See #3097)
urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • ⚠️ Fix generated empty Variables type as passed to generics, that outputs a type of { [var: string]: never; }.
    A legacy/unsupported version of typescript-urql, which wraps urql's React hooks, generates
    empty variables types as the following code snippet, which is not detected:
    type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
    type Variables = Exact<{ [key: string]: never }>;
    
    Submitted by @kitten (See #3029)
urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • ⚠️ Fix type utilities turning the variables properties optional when a type from TypedDocumentNode has no Variables or all optional Variables. Previously this would break for wrappers, e.g. in code generators, or when the type didn't quite match what we'd expect
    Submitted by @kitten (See #3022)
  • Updated dependencies (See #3007, #2962, #3007, #3015, and #3022)
urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • Introduce maxDepth and skipType into the populateExchange, these options allow you to specify
    the maximum depth a mutation should be populated as well as which types should not be counted towards
    this depth
    Submitted by @JoviDeCroock (See #3023)

Patch Changes

urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • ⚠️ Fix type utilities turning the variables properties optional when a type from TypedDocumentNode has no Variables or all optional Variables. Previously this would break for wrappers, e.g. in code generators, or when the type didn't quite match what we'd expect
    Submitted by @kitten (See #3022)
  • Updated dependencies (See #3007, #2962, #3007, #3015, and #3022)
urql - @urql/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • Add isOfflineError option to the offlineExchange to allow it to be customized to different conditions to determine whether an operation has failed because of a network error
    Submitted by @robertherber (See #3020)
  • Allow updates config to react to arbitrary type updates other than just Mutation and Subscription fields.
    You’ll now be able to write updaters that react to any entity field being written to the cache,
    which allows for more granular invalidations. Note: If you’ve previously used updates.Mutation
    and updated.Subscription with a custom schema with custom root names, you‘ll get a warning since
    you’ll have to update your updates config to reflect this. This was a prior implementation
    mistake!
    Submitted by @kitten (See #2979)

Patch Changes

  • ⚠️ Fix regression which caused partial results, whose refetches were blocked by the looping protection, to not have a stale: true flag added to them. This is a regression from https://github.com/urql-graphql/urql/pull/2831 and only applies to cacheExchanges that had the schema option set
    Submitted by @kitten (See #2999)
  • Add invariant to data layer that prevents cache writes during cache query operations. This prevents cache.writeFragment, cache.updateQuery, and cache.link from being called in resolvers for instance
    Submitted by @kitten (See #2978)
  • Updated dependencies (See #3007, #2962, #3007, #3015, and #3022)
urql - [email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • ⚠️ Fix type utilities turning the variables properties optional when a type from TypedDocumentNode has no Variables or all optional Variables. Previously this would break for wrappers, e.g. in code generators, or when the type didn't quite match what we'd expect
    Submitted by @kitten (See #3022)
  • Updated dependencies (See #3007, #2962, #3007, #3015, and #3022)