Releases: urql-graphql/urql
Releases · urql-graphql/urql
@urql/core@4.1.1
Patch Changes
- Add case for
subscriptionExchange
to handleGraphQLError[]
received in theerror
observer callback.
Note: This doesn't strictly check for theGraphQLError
shape and only checks for arrays and receiving errors in theExecutionResult
on thenext
observer callback is preferred and recommended for transports
Submitted by @kitten (See #3346)
@urql/exchange-graphcache@6.3.1
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 enablinginfo.partial
while a parent may abort early instead
Submitted by @kitten (See #3340) ⚠️ Fix@_optional
directive not settinginfo.partial = true
on cache miss and fix usage ofinfo.parentKey
andinfo.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
Patch Changes
⚠️ FixqueryStore
andsubscriptionStore
not subscribing whenwritable
calls itsStartStopNotifier
. 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 theClient
Submitted by @kitten (See #3331)
@urql/exchange-graphcache@6.3.0
Minor Changes
- Allow scalar values on the parent to be accessed from
parent[info.fieldName]
consistently. Prior to this changeparent[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 returnundefined
when a value is not cached to make it easier to cause a cache miss in resolvers. Reminder: Returningundefined
from a resolver means a field is uncached, while returningnull
means that a field’s value isnull
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 usingcache.resolve(entity, '__typename')
which doesn't cause the cache to record a dependency
Submitted by @kitten (See #3335) ⚠️ Fix cases whereResolveInfo
’sparentFieldKey
was incorrectly populated with a key that isn’t a field key (allowing forcache.resolve(info.parentKey, info.parentFieldKey)
to be possible) but was instead set toinfo.parentKey
combined with the field key
Submitted by @kitten (See #3336)
urql@4.0.5
Patch Changes
⚠️ Fix edge case that causes execute functions fromuseQuery
anduseSubscription
to fail when they’re called in their state after a render that changespause
. 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
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
@urql/exchange-graphcache@6.2.0
Minor Changes
- Implement local directives. It’s now possible to add client-only directives to queries by adding them to the
cacheExchange
’s newdirectives
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 thedirectives
config are
executed. This means it’s now possible to use@_relayPagination
for example, by passing adding
therelayPagination
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 thatformatDocument
adds
Submitted by @kitten (See #3317) - Allow
offlineExchange
to once again issue all request policies, instead of mapping them tocache-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
'scacheExchange
Submitted by @kitten (See #3308) - Updated dependencies (See #3317 and #3308)
- @urql/core@4.1.0
@urql/core@4.1.0
Minor Changes
- Update
formatDocument
to outputFormattedNode
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
@urql/svelte@4.0.3
Patch Changes
- Updated peer dependency range to include support for Svelte
^4.0.0
Submitted by @ategen3rt (See #3302)