Skip to content

Releases: urql-graphql/urql

@urql/core@4.1.1

30 Jul 16:57
15f12ae
Compare
Choose a tag to compare

Patch Changes

  • Add case for subscriptionExchange to handle GraphQLError[] received in the error observer callback.
    Note: This doesn't strictly check for the GraphQLError shape and only checks for arrays and receiving errors in the ExecutionResult on the next observer callback is preferred and recommended for transports
    Submitted by @kitten (See #3346)

@urql/exchange-graphcache@6.3.1

27 Jul 14:58
743e5b4
Compare
Choose a tag to compare

Patch Changes

  • Reset partial result marker when reading from selections when a child value sees a cache miss. This only affects resolvers on child values enabling info.partial while a parent may abort early instead
    Submitted by @kitten (See #3340)
  • ⚠️ Fix @_optional directive not setting info.partial = true on cache miss and fix usage of info.parentKey and info.parentFieldKey usage in default directives
    Submitted by @kitten (See #3338)
  • Replace implementation for @_optional and @_required with built-in handling inside cache reads to allow @_optional to work for nested selection sets
    Submitted by @kitten (See #3341)

@urql/svelte@4.0.4

26 Jul 21:08
abf77f4
Compare
Choose a tag to compare

Patch Changes

  • ⚠️ Fix queryStore and subscriptionStore not subscribing when writable calls its StartStopNotifier. This caused both stores to be inactive and become unresponsive when they’ve been unsubscribed from once, as they wouldn’t be able to restart their subscriptions to the Client
    Submitted by @kitten (See #3331)

@urql/exchange-graphcache@6.3.0

26 Jul 21:08
abf77f4
Compare
Choose a tag to compare

Minor Changes

  • Allow scalar values on the parent to be accessed from parent[info.fieldName] consistently. Prior to this change parent[fieldAlias] would get populated, which wouldn’t always result in a field that’s consistently accessible
    Submitted by @kitten (See #3336)
  • Allow cache.resolve to return undefined when a value is not cached to make it easier to cause a cache miss in resolvers. Reminder: Returning undefined from a resolver means a field is uncached, while returning null means that a field’s value is null without causing a cache miss
    Submitted by @kitten (See #3333)

Patch Changes

  • Record a dependency when __typename field is read. This removes a prior, outdated exception to avoid confusion when using cache.resolve(entity, '__typename') which doesn't cause the cache to record a dependency
    Submitted by @kitten (See #3335)
  • ⚠️ Fix cases where ResolveInfo’s parentFieldKey was incorrectly populated with a key that isn’t a field key (allowing for cache.resolve(info.parentKey, info.parentFieldKey) to be possible) but was instead set to info.parentKey combined with the field key
    Submitted by @kitten (See #3336)

urql@4.0.5

21 Jul 15:33
e5fa521
Compare
Choose a tag to compare

Patch Changes

  • ⚠️ Fix edge case that causes execute functions from useQuery and useSubscription to fail when they’re called in their state after a render that changes pause. This would previously cause internal dependencies to be outdated and the source to be discarded immediately in some cases
    Submitted by @kitten (See #3323)
  • Updated dependencies (See #3317 and #3308)
    • @urql/core@4.1.0

@urql/next@1.0.0

21 Jul 15:33
e5fa521
Compare
Choose a tag to compare

Major Changes

  • Create @urql/next which is a package meant to support Next 13 and
    the React 18 features contained within.
    For server components we have @urql/next/rsc and for client components
    just @urql/next
    Submitted by @JoviDeCroock (See #3214)

@urql/exchange-persisted@4.1.0

21 Jul 15:33
e5fa521
Compare
Choose a tag to compare

Minor Changes

  • Allow persisted query logic to be skipped by the persistedExchange if the passed generateHash function resolves to a nullish value. This allows (A)PQ to be selectively disabled for individual operations
    Submitted by @kitten (See #3324)

Patch Changes

  • Updated dependencies (See #3317 and #3308)
    • @urql/core@4.1.0

@urql/exchange-graphcache@6.2.0

21 Jul 15:33
e5fa521
Compare
Choose a tag to compare

Minor Changes

  • Implement local directives. It’s now possible to add client-only directives to queries by adding them to the cacheExchange’s new directives option.
    Directives accept an object of their arguments and return a resolver. When a field is annotated with
    a resolver, e.g. @_optional or @_required, their resolvers from the directives config are
    executed. This means it’s now possible to use @_relayPagination for example, by passing adding
    the relayPagination helper to the config.
    Due to the change in #3317, any directive in
    queries that’s prefixed with an underscore (_) is only visible to Graphcache and not the API.
    Submitted by undefined (See #3306)

Patch Changes

  • Use new FormattedNode / formatDocument functionality added to @urql/core to slightly speed up directive processing by using the client-side _directives dictionary that formatDocument adds
    Submitted by @kitten (See #3317)
  • Allow offlineExchange to once again issue all request policies, instead of mapping them to cache-first. When replaying operations after rehydrating it will now prioritise network policies, and before rehydrating receiving a network result will prevent a network request from being issued again
    Submitted by @kitten (See #3308)
  • Add OperationContext.optimistic flag as an internal indication on whether a mutation triggered an optimistic update in @urql/exchange-graphcache's cacheExchange
    Submitted by @kitten (See #3308)
  • Updated dependencies (See #3317 and #3308)
    • @urql/core@4.1.0

@urql/core@4.1.0

21 Jul 15:33
e5fa521
Compare
Choose a tag to compare

Minor Changes

  • Update formatDocument to output FormattedNode type mapping. The formatter will now annotate added __typename fields with _generated: true, place selection nodes' directives onto a _directives dictionary, and will filter directives to not include "_" underscore prefixed directives in the final query. This prepares us for a feature that allows enhanced client-side directives in Graphcache
    Submitted by @kitten (See #3317)

Patch Changes

  • Add OperationContext.optimistic flag as an internal indication on whether a mutation triggered an optimistic update in @urql/exchange-graphcache's cacheExchange
    Submitted by @kitten (See #3308)

@urql/svelte@4.0.3

12 Jul 15:43
76ad619
Compare
Choose a tag to compare

Patch Changes

  • Updated peer dependency range to include support for Svelte ^4.0.0
    Submitted by @ategen3rt (See #3302)