@apollo/client
4.3.5 · 19 Oct 2026MIT5.3M / weekRepositoryHomepagenpmAtom feed
209 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 4.x · latest line
4.3.5
19 Oct 2026Fix an issue where custom scalar values that are not JSON-serializable caused errors. These values are properly serialized when used as input for
variablesor when used as a key field value so that cache writes and calls tocache.identifysucceed.Require the
variablesoption inuseFragmentwhen the fragment has required variables. This matches the behavior ofuseSuspenseFragmentand the query hooks.Parse custom scalar fields in subscription results when using the
no-cachefetch policy.
4.3.4
16 Oct 2026Fix an issue where a list field selected more than once with different selection sets lost the fields that only one of the selections included while a
@deferboundary elsewhere in the query was still pending when using theGraphQL17Alpha9Handler. The results of all selections of the list field are now merged.Fixed a bug where
streamFieldInfomight not have been passed into custom merge functions for@streamdirectives that had an aliased field in the path.Fix
Missing fielderrors being logged when writing@deferresults where a parent field is selected both inside and outside of a deferred fragment. Fields whose@deferboundary has not been delivered from the network are no longer reported as missing.
Patch Changes
Fix an issue where a list field selected more than once with different selection sets lost the fields that only one of the selections included while a
@deferboundary elsewhere in the query was still pending when using theGraphQL17Alpha9Handler. The results of all selections of the list field are now merged.Fixed a bug where
streamFieldInfomight not have been passed into custom merge functions for@streamdirectives that had an aliased field in the path.Fix
Missing fielderrors being logged when writing@deferresults where a parent field is selected both inside and outside of a deferred fragment. Fields whose@deferboundary has not been delivered from the network are no longer reported as missing.Unregister the watch when an immediate
cache.watchbroadcast throws. Previously the watch was added to the cache before its first read, and a read that threw left the watch registered while the caller never received the unsubscribe function, so it could not be removed and every later broadcast ran into the same failing read.Defer20220824Handler: fix a situation wheredataStatewould show up ascompletedwith incremental errors instead of stayingstreaming.
4.3.3
8 Oct 2026Fix a memory leak in
isDeferredFragment/isStreamField
4.3.2
5 Oct 2026Fix an unhandled
AbortErrorpromise rejection that occurred when unsubscribing from a multipart HTTP subscription.
4.3.1
18 Sep 2026Fix an issue where
useLazyQuerydid not rerender with newvariablesuntil the network request had completed when callingexecutewith new variables while a request was already in-flight.
4.3.0
11 Sep 2026- removed
Remove the optional modifier from the
variablesproperty provided to theupdatefunction inclient.mutateanduseMutation.variablesis always a defined object, even when variables are not provided to the mutation. - deprecated
Mark
skipas deprecated inuseQueryanduseSubscriptionnow that both of these hooks supportskipToken. Field policies and
inputObjectscan now tell the cache whether a field is a list of scalars or a scalar whose value is an array. Previously all arrays were iterated and only the inner type was provided to the scalarparse/serializefunctions.This required some breaking changes from previous prerelease versions:
new InMemoryCache({ scalars: { DateTime: new Scalar(/*...*/), }, inputObjects: { EventFilter: { fields: { // Previously only the scalar type was provided datesBefore: "DateTime", // List syntax now required datesAfter: "[DateTime]", dates2d: "[[DateTime]]", }, }, }, typePolicies: { Event: { fields: { // Previously only the scalar type was provided datesBefore: { scalar: "DateTime", }, // List syntax now required datesAfter: { scalar: "[DateTime]", }, dates2d: { scalar: "[[DateTime]]", }, }, }, }, });Now it's possible to handle scalars that are represented by arrays:
const dateTimeRangeScalar = new Scalar< [string, string], { start: Date; end: Date } >({ parse: ([start, end]) => ({ start: new Date(start), end: new Date(end), }), serialize: (range) => [range.start.toISOString(), range.end.toISOString()], is: (value) => !Array.isArray(value), }); const cache = new InMemoryCache({ scalars: { DateTimeRange: dateTimeRangeScalar, }, typePolicies: { Event: { fields: { range: { scalar: "DateTimeRange", }, }, }, }, }); const query = gql` query { event { range } } `; cache.writeQuery({ query, data: { event: { __typename: "Event", // Server returns DateTimeRange as a JSON array range: ["2024-01-01T00:00:00Z", "2024-06-01T00:00:00Z"], }, }, }); const { data } = useQuery(query); // => { event: { __typename: "Event", range: { start: Date, end: Date } } }
Minor Changes
Field policies and
inputObjectscan now tell the cache whether a field is a list of scalars or a scalar whose value is an array. Previously all arrays were iterated and only the inner type was provided to the scalarparse/serializefunctions.This required some breaking changes from previous prerelease versions:
The field policy
scalaroption andinputObjectstype string now use GraphQL list syntax to mark a field as a list of scalarsThe abstract
cache.getScalarForFieldis nowcache.getScalarTypeForFieldand is expected to return the string representing the scalar type rather than theScalarinstance
new InMemoryCache({ scalars: { DateTime: new Scalar(/*...*/), }, inputObjects: { EventFilter: { fields: { // Previously only the scalar type was provided datesBefore: "DateTime", // List syntax now required datesAfter: "[DateTime]", dates2d: "[[DateTime]]", }, }, }, typePolicies: { Event: { fields: { // Previously only the scalar type was provided datesBefore: { scalar: "DateTime", }, // List syntax now required datesAfter: { scalar: "[DateTime]", }, dates2d: { scalar: "[[DateTime]]", }, }, }, }, });Now it's possible to handle scalars that are represented by arrays:
const dateTimeRangeScalar = new Scalar< [string, string], { start: Date; end: Date } >({ parse: ([start, end]) => ({ start: new Date(start), end: new Date(end), }), serialize: (range) => [range.start.toISOString(), range.end.toISOString()], is: (value) => !Array.isArray(value), }); const cache = new InMemoryCache({ scalars: { DateTimeRange: dateTimeRangeScalar, }, typePolicies: { Event: { fields: { range: { scalar: "DateTimeRange", }, }, }, }, }); const query = gql` query { event { range } } `; cache.writeQuery({ query, data: { event: { __typename: "Event", // Server returns DateTimeRange as a JSON array range: ["2024-01-01T00:00:00Z", "2024-06-01T00:00:00Z"], }, }, }); const { data } = useQuery(query); // => { event: { __typename: "Event", range: { start: Date, end: Date } } }Fix the accuracy of
dataStatein complex incremental streaming scenarios, especially when combined withreturnPartialData: true.Prior to this change, all intermediate chunks used for both
@deferand@streamdirectives returned adataStateofstreaming, regardless of whether the actual data shape fit the definition of thestreamingdata state. Thestreamingdata state represents an incomplete incremental response where the only holes in the data occur at@deferboundaries.Let's use the following example of where the previous
dataStatefell down when combined withreturnPartialData.query GreetingQuery { greeting { message ... @defer { recipient { name email } } } }Scenario 1: partial data inside a
@deferboundary written to the cache
Let's say the cache contained the following partial data:
{ greeting: { __typename: "Greeting", recipient: { __typename: "Person", name: "John Doe", }, }, };After the first chunk arrives from the server, the data looks like the following:
{ greeting: { __typename: "Greeting", message: "Hello, John", recipient: { __typename: "Person", name: "John Doe", }, }, };This data is not
completebecauserecipient.emailis missing. This data is also notstreamingbecause the data requirements in the@deferboundary are partially fulfilled due to the existence ofrecipient. This could lead to runtime crashes onrecipient.emailif you use the existence ofrecipientto detect whether data in the@deferboundary has streamed in or not. This change now accurately reports this aspartialto ensure the field is marked as a partial field inrecipient.Scenario 2: partial data written to the cache that fulfills the data requirements of the
@deferboundary
Let's say the cache contained the following partial data:
{ greeting: { __typename: "Greeting", recipient: { __typename: "Person", name: "John Doe", email: "john@example.com", }, }, };After the first chunk arrives from the server, the data looks like the following:
{ greeting: { __typename: "Greeting", message: "Hello, John", recipient: { __typename: "Person", name: "John Doe", email: "john@example.com", }, }, };In this case, the combination of the first chunk and the partial data in the cache now fulfills the data requirements of the query. Even though the server is still streaming data (
NetworkStatus.streaming), we can report this asdataState: "complete"since it is safe to access data on all fields.This change also means
@streamqueries by definition fulfill the data requirements of the query after the first chunk arrives since@streamoperates on lists and contains no data holes.@streamqueries now accurately reportdataStateascompleteorpartial, depending on whether the list mixes partial data with streamed list items.As a result of this change, some cases where you'd previously see
dataStatereported as"streaming"are now reported aspartialorcomplete.If you use
dataStateto determine whether an incremental request is still in-flight, please usenetworkStatusinstead to check forNetworkStatus.streaming.dataStateis type narrowing feature and not intended to report the network status.Adds
Scalar.fromGraphQLScalarTypehelper to create aScalarinstance from an existing graphql.jsGraphQLScalarType.import { GraphQLScalarType } from "graphql"; import { Scalar } from "@apollo/client"; const dateTimeScalarType = new GraphQLScalarType<Date, string>({ // ... }); const dateTimeScalar = Scalar.fromGraphQLScalarType(dateTimeScalarType, { is: (value) => value instanceof Date, });The minimum supported TypeScript version is now 5.9.x.
Adds the plumbing and types implementation for declaring custom scalars and configuring custom scalars in
InMemoryCache.You can declare custom scalar types with declaration merging on the
ApolloCache.Scalarsinterface:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { namespace ApolloCache { interface Scalars { Date: { serialized: string; parsed: Date }; } } }This enables the
scalarsoption inInMemoryCache:import { Scalar } from "@apollo/client"; const cache = new InMemoryCache({ scalars: { Date: new Scalar({ parse: (dateString) => new Date(dateString), serialize: (date) => date.toISOString(), is: (value) => value instanceof Date, }), }, });Add the ability to define the cache type for the client.
client.cachecurrently returnsApolloCacheas the cache type regardless of what cache you've provided toApolloClient.Declare the cache type using the
cacheproperty in theTypeOverridesinterface to set the cache implementation used for the client.// apollo.d.ts import type { InMemoryCache } from "@apollo/client"; declare module "@apollo/client" { export interface TypeOverrides { cache: InMemoryCache; } }Now anywhere
cacheis accessible, the type is the declared cache type:client.cache; // ^? InMemoryCache client.mutate({ update: (cache) => { // ^? InMemoryCache }, });Note
Setting a cache type enforces that cache type in the
cacheoption for theApolloClientconstructor.Emit a development-only warning when a feud is detected between queries that overwrite each other's data. This should make it easier to detect when you need to select a key field or add a
mergefunction to a field policy.Fix issue where sibling
@deferfragments were pruned incorrectly when at least one of the@deferfragments wasn't delivered.As a result of this change, a
labelargument is now added to all outgoing@deferdirectives when using theGraphQL17Alpha9Handlerin order to disambiguate the@deferfragments from each other.Version bump only to
rc.Add
GraphQLCodegenIncrementaltype overrides that assemble GraphQL Codegen@deferoperation types whendataStateis"complete".Parse scalar fields for
no-cachequeries.Support
skipTokenwithuseSubscriptionto provide a more type-safe way to skip subscription execution with required variables.import { skipToken, useSubscription } from "@apollo/client/react"; // Use `skipToken` in place of `skip: true` for better type safety // for required variables const { data } = useSubscription( SUBSCRIPTION, id ? { variables: { id } } : skipToken );Allow overriding the
frominput ofuseFragment,useSuspenseFragment,readFragment,writeFragmentand related fragment APIs via a newFromOptionValuekey on theTypeOverridesinterface.By default,
fromcontinues to acceptStoreObject | Reference | FragmentType<TData> | string. Apps can now supply a stricter policy (for example, requiring__typenameand disallowing nullish identifier values) without affectingStoreObject,cache.identify,cache.modifyor optimistic writes.// apollo.d.ts import "@apollo/client"; import type { HKT, StoreValue } from "@apollo/client/utilities"; type StrictFrom<TData extends { __typename: string }> = | { // the `__typename` has to match the one of the fragment type __typename: TData["__typename"]; // `& {}` forces values to be "defined" so an explicit `undefined` // (as well as `null`) is rejected. [key: string]: Exclude<StoreValue, null | undefined> & {}; } | { __ref: string } | string | null; interface StrictFromHKT extends HKT { arg1: { __typename: string }; // TData return: StrictFrom<this["arg1"]>; } declare module "@apollo/client" { export interface TypeOverrides { FromOptionValue: StrictFromHKT; } }Field policy
readandmergefunctions are now ignored when the field policy configures thescalaroption. If areadormergefunction is provided alongsidescalar, a development-only warning is emitted.Change when
@deferfragments and@streamfields are pruned forcache-firstandcache-and-networkfetch policies to better match the network when the initial value contained a partial result:cache-first: prune undelivered@deferfragments or@streamitems when the result is fetched from the network due to a partial resultcache-and-network: prune undelivered@deferfragments or@streamitems if the initial cache value was partial. If the first value emitted from the cache is complete, the results will not be pruned.
This makes the emitted results more predictable by following what the network has delivered and avoids some ambiguity in other edge cases.
For example, with a
cache-firstfetch policy where all@deferfields are written to the cache, but a non-deferred field is partial, the values emitted from the client previously looked like the following:query { user { id name ... @defer { email } } }// data written to the cache is missing name { user: { id: 1, email: "user.cache@example.com" }} // 1. empty because the result is partial { data: undefined, dataState: "empty", ... } // 2. returns all data because the cache contains a value for email { data: { user: 1, name: "User", email: "user.cache@example.com" }, dataState: "complete" } // 3. email updated from the server { data: { user: 1, name: "User", email: "user.network@example.com" }, dataState: "complete" }Here the result is confusing because the initial value returned from the query was
undefined, yet a complete result was returned after the initial chunk from the network returned (which did not containemail).The cache values are now pruned if the network hasn't delivered them yet:
// 1. empty because the result is partial { data: undefined, dataState: "empty" } // 2. email hasn't been delivered by the network so it gets pruned { data: { user: 1, name: "User" }, dataState: "streaming" } // 3. full result returned after the network streams the email field { data: { user: 1, name: "User", email: "user.network@example.com" }, dataState: "complete" }This is especially helpful in situations where
@deferboundaries that are never delivered due to errors prevent an awkward situation where the client would otherwise have to choose whether to serve the stale cache result from the cache, or prune the undelivered fragment on the final chunk.Adds a
scalaroption toInMemoryCachefield policies that tells the cache which scalar to use when parsing or serializing the field value.import { Scalar } from "@apollo/client"; new InMemoryCache({ scalars: { DateTime: new Scalar({ parse: (dateString) => new Date(dateString), serialize: (date) => date.toISOString(), }), }, typePolicies: { Event: { fields: { startTime: { // Parse this field using the DateTime scalar scalar: "DateTime", }, }, }, }, });This scalar definition is now used to properly parse or serialize the field value for cache reads and writes as well as
cache.extract()andcache.restore().Automatically serialize variables that include custom scalar values. This includes cache reads and writes as well as requests to the network.
For more complex input objects, a new
inputObjectsoption is available toInMemoryCachethat specifies where nested scalar fields are found.const cache = new InMemoryCache({ scalars: { DateTime: new Scalar({ parse: (value) => new Date(value), serialize: (value) => value.toISOString(), is: (value) => value instanceof Date, }), }, inputObjects: { EventFilter: { fields: { date: "DateTime", }, }, }, }); const client = new ApolloClient({ cache, link }); await client.query({ query: gql` query Event($filter: EventFilter!) { event(filter: $filter) { name } } `, variables: { filter: { date: new Date("2026-01-01T00:00:00.000Z"), }, }, }); // The link receives: // { filter: { date: "2026-01-01T00:00:00.000Z" } }Remove the custom
NoInfertype utility in favor of the nativeNoInferintroduced in TypeScript 5.4.Adds the
getScalarabstract method toApolloCachethat cache subclasses override to provide scalar behavior to Apollo Client. Defaults to unconditionally returnundefinedif not specified.Fixes an issue where cache feuds between queries selecting incompatible non-normalized data could return untransformed network values.
Apollo Client now always writes network results to the cache before delivering them, ensuring custom scalars and field
readfunctions are applied. To prevent repeated refetches when competing queries repeatedly make each other's cache results incomplete, Apollo Client stops automatically refetching a query after it sees the same incomplete result again.This may add one network request in these cache-feud scenarios.
Make sure scalars are correctly returned for mutations and subscriptions.
Note
This change affects cache reads after mutations as mutations now reread from the cache after each execution that writes a result to the cache. Previously mutations only reread from the cache when an
updatefunction was provided. This can have an effect on the result if you have union or interface types in the mutation but forget to includepossibleTypeswhich might return a result that doesn't include the interface/union fields.Patch Changes
Fix
dataStateto report"streaming"instead of"partial"whenreturnPartialDataistrueand the cache result is missing only@deferfields.Fix an issue where a
network-onlyquery leaked partial cache data for@deferfragments that were not delivered by the network due to an error that bubbled to the@deferfragment boundary.Fix an issue where a sibling non-deferred fragment might be accidentally pruned when the
@deferfragment hadn't been delivered.- removed
Remove the optional modifier from the
variablesproperty provided to theupdatefunction inclient.mutateanduseMutation.variablesis always a defined object, even when variables are not provided to the mutation. Fix an issue where field
readfunctions were not applied to intermediate results while streaming@deferresponses.cache.diffran thereadfunctions, but the transformed values were only applied to the emitted result when the updated cache result was considered complete. Intermediate chunks whose only holes were at@deferboundaries now correctly return the result of fieldreadfunctions.new InMemoryCache({ typePolicies: { Greeting: { fields: { message: { read: (message) => message.toUpperCase(), }, }, }, }, }); // query GreetingQuery { // greeting { // message // ... @defer { // recipient { name } // } // } // } // First chunk previously returned: // { greeting: { message: "Hello world" } } // // Now correctly returns while still streaming: // { greeting: { message: "HELLO WORLD" } }Fix issue where the wrong
dataStatewas returned when there was nothing written to the cache and a@deferfragment was marked pending.Fix an issue where
network-onlyincremental queries could cause cache data to leak into the emitted result when a@deferor@streamboundary already had complete data in the cache. Cache data inside pending@deferobjects and@streamarrays are now pruned so that only completed@deferor@streamboundaries are returned.NOTE: This change only applies to
InMemoryCachewhen usingGraphQL17Alpha9Handler.Cache diffs for incomplete queries no longer pay the cost of building a full
MissingFieldErrorwhen themissingproperty is not accessed. The error object is now only constructed when themissingproperty is accessed the first time. This improves performance by avoiding a V8 stack capture whenmissingis ignored entirely.As an additional small performance improvement,
JSON.stringifyis no longer used in the error message on objects whose cache ID is known.JSON.stringifyis only used for non-normalized objects.Fix an issue where a
@deferquery reported thedataStateascompleteinstead ofstreamingwhen an error occurs on a deferred field that bubbled to the defer boundary.Fix an issue with
@streamqueries when usingreturnPartialData: truewhere the streamed list was truncated after the first incremental chunk when the list contained partial cache data. The list is no longer truncated and partial list items are now retained as incremental chunks arrive. ThedataStateis now reported aspartialuntil the server has streamed enough of the list so that each list item fully satisfies the query.This change also updates
@streamqueries so that they reported withdataState: "completeinstead of"streaming"since it is safe to access all fields in the response.Fix an issue where a cache write in the middle of polling would remain as the query value if future poll requests returned deep equal results to previous polling results.
- deprecated
Mark
skipas deprecated inuseQueryanduseSubscriptionnow that both of these hooks supportskipToken. Fix issue where setting
returnPartialData: truemight report the wrongdataStatewhen partial data was written to the cache and@deferfragments were pending.Fix an issue where partial cache data could leak into intermediate incremental results. This could cause runtime crashes if you relied on the presence of values to determine whether the
@deferdata had streamed in or not.Fix an invariant error thrown when a
@deferboundary received a payload after it had already been marked complete.Align the remaining cache generic constraints with
Cache.Implementation. The deprecated React mutation types (MutationHookOptions,MutationFunctionOptions,MutationTuple) and the internalInternalRefetchQueriesOptionsandQueryInfotypes still constrained their cache type parameter toApolloCache, so they now match the rest of the overridable cache API.
4.2.12
14 Aug 2026Preserve multi-byte UTF-8 characters split across multipart response chunks.
4.2.11
11 Aug 2026Fix type signature of some
DocumentationTypesto fix their display in our documentation.Add a development-only warning when a network result is written to the cache but reading the query back from the cache returns a partial result. This usually points at a
mergeorreadfunction that did not repair missing fields in the cache, which prevents Apollo Client from applying the cache result to the data received by the network.
4.2.10
5 Aug 2026Fix accidental widening of the
client.mutatereturn type whenoptimisticResponsewas present.Fix result types widened when a query's variables had constant types (e.g.
TypedDocumentNode<Data, { type: "main" }>). This caused options such asreturnPartialDataorerrorPolicyto be reported as their widened types (e.g.boolean,ErrorPolicy) instead of the value that was passed which returned the wrongdataanddataStatetypes.Fix issue where unknown options were permitted by TypeScript when passed alongside a valid option to APIs with modern signatures.
Patch Changes
Fix accidental widening of the
client.mutatereturn type whenoptimisticResponsewas present.Fix result types widened when a query's variables had constant types (e.g.
TypedDocumentNode<Data, { type: "main" }>). This caused options such asreturnPartialDataorerrorPolicyto be reported as their widened types (e.g.boolean,ErrorPolicy) instead of the value that was passed which returned the wrongdataanddataStatetypes.Fix issue where unknown options were permitted by TypeScript when passed alongside a valid option to APIs with modern signatures.
Update the return type of
refetch,fetchMoreanduseLazyQuery'sexecutefunction on the providederrorPolicy. Previously these APIs all used the default type which typeddataasTData | undefinedanderrorasErrorLike | undefined.
4.2.9
30 Jul 2026Fix a bug where GraphQL variable default values were not applied during cache reads when variables with defaults were explicitly set to
undefined. This caused@include/@skipdirectives to throw "Invalid variable referenced" errors when the variable was passed asundefinedinstead of being omitted entirely.Fix an issue where some
@exportqueries would not react to cache updates when the fields keyed by exported variables were updated.
4.2.8
23 Jul 2026Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.
4.2.7
13 Jul 2026Cleanup some unused internals. Please file an issue if you notice anything change.
4.2.6
6 Jul 2026Prevent relay multipart subscriptions from issuing a fetch request after serializing the request body fails.
Speed up cache writes by avoiding a full AST
visitof every written field to detect@stream. The check now runs only when the result carries stream info, and only inspects the field node's own directives. As a result, fields that merely contain@streamon a nested field are no longer treated as streamed themselves and now overwrite existing lists like regular fields instead of merging chunk-wise.
4.2.5
1 Jul 2026Export
KeyArgsFunctionandRelayFieldPolicytypes from public entrypoints.
4.2.4
30 Jun 2026Fixes an issue where
client.readFragmentandclient.readQueryignored theoptimisticoption when passed in the options object.
4.2.3
8 Jun 2026Add support for
graphqlv17 as a valid peer dependency.
4.2.2
3 Jun 2026Preserve referential equality of masked data on refetch when the result is deeply equal to the previous result.
4.2.1
2 Jun 2026Fixes an issue where
useLazyQuerywould not apply a changedpollIntervalbetween renders.
4.2.0
20 May 2026Introduce "classic" and "modern" method and hook signatures.
Apollo Client 4.2 introduces two signature styles for methods and hooks. All signatures previously present are now "classic" signatures, and a new set of "modern" signatures are added alongside them.
Classic signatures are the default and are identical to the signatures before Apollo Client 4.2, preserving backward compatibility. Classic signatures still work with manually specified TypeScript generics (e.g.,
useSuspenseQuery<MyData>(...)). However, manually specifying generics has been discouraged for a long time—instead, we recommend usingTypedDocumentNodeto automatically infer types, which provides more accurate results without any manual annotations.Modern signatures automatically incorporate your declared
defaultOptionsinto return types, providing more accurate types. Modern signatures infer types from the document node and do not support manually passing generic type arguments; TypeScript will produce a type error if you attempt to do so.Methods and hooks automatically switch to modern signatures the moment any non-optional property is declared in
DeclareDefaultOptions. The switch happens across all methods and hooks globally:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { namespace ApolloClient { namespace DeclareDefaultOptions { interface WatchQuery { errorPolicy: "all"; // non-optional → modern signatures activated automatically } } } }Users can also manually switch to modern signatures without declaring any
defaultOptions, for example when wanting accurate type inference without relying on globaldefaultOptions:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { export interface TypeOverrides { signatureStyle: "modern"; } }Users can do a global
DeclareDefaultOptionstype augmentation and then manually switch back to "classic" for migration purposes:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { export interface TypeOverrides { signatureStyle: "classic"; } }Note that this is not recommended for long-term use. When combined with
DeclareDefaultOptions, switching back to classic results in the same incorrect types as before Apollo Client 4.2—methods and hooks will not reflect thedefaultOptionsyou've declared.Improve the accuracy of
client.queryreturn type to better detect the currenterrorPolicy. Thedataproperty is no longer nullable when theerrorPolicyisnone. This makes it possible to remove theundefinedchecks or optional chaining in most cases.Add support for automatic event-based refetching, such as window focus.
The
RefetchEventManagerclass handles automatic refetches in response to events. Apollo Client provides built-in sources for window focus and network reconnect aswindowFocusSourceandonlineSource.Event refetching is fully opt-in. Create and pass a
RefetchEventManagerinstance to theApolloClientconstructor to activate the event listeners.import { ApolloClient, InMemoryCache, RefetchEventManager, windowFocusSource, onlineSource, } from "@apollo/client"; const client = new ApolloClient({ link, cache: new InMemoryCache(), refetchEventManager: new RefetchEventManager({ sources: { // Refetch when window is focused windowFocus: windowFocusSource, // Refetch when the user comes back online online: onlineSource, }, }), });By default, all active queries refetch when the events fire. Queries can opt out per-event or disable all event refetches:
// Skip refetch on window focus for this query, but keep `online` useQuery(QUERY, { refetchOn: { windowFocus: false }, }); // Disable all event-driven refetches for this query useQuery(OTHER_QUERY, { refetchOn: false, }); // Enable every event for this query, regardless of defaultOptions useQuery(LIVE_DASHBOARD, { refetchOn: true, }); // Dynamically enable or disable a refetch when the event fires useQuery(LIVE_DASHBOARD, { refetchOn: ({ source, payload }) => { if (source === "windowFocus") { // payload is the data associated with the event return someCondition(payload); } return true; }, }); // Dynamically enable or disable a refetch for a specific event useQuery(LIVE_DASHBOARD, { refetchOn: { windowFocus: ({ payload }) => { // payload is the data associated with the event return someCondition(payload); }, }, });To enable per-query opt-in rather than opt-out, set
defaultOptions.watchQuery.refetchOntofalseand enable it per-query instead.const client = new ApolloClient({ link, cache, refetchEventManager: new RefetchEventManager({ sources: { windowFocus: windowFocusSource }, }), defaultOptions: { watchQuery: { refetchOn: false }, }, }); // Only this query refetches on window focus useQuery(DASHBOARD_QUERY, { refetchOn: { windowFocus: true } });When
defaultOptions.watchQuery.refetchOnand per-queryrefetchOnoptions are provided, the objects are merged together.
Minor Changes
Introduce "classic" and "modern" method and hook signatures.
Apollo Client 4.2 introduces two signature styles for methods and hooks. All signatures previously present are now "classic" signatures, and a new set of "modern" signatures are added alongside them.
Classic signatures are the default and are identical to the signatures before Apollo Client 4.2, preserving backward compatibility. Classic signatures still work with manually specified TypeScript generics (e.g.,
useSuspenseQuery<MyData>(...)). However, manually specifying generics has been discouraged for a long time—instead, we recommend usingTypedDocumentNodeto automatically infer types, which provides more accurate results without any manual annotations.Modern signatures automatically incorporate your declared
defaultOptionsinto return types, providing more accurate types. Modern signatures infer types from the document node and do not support manually passing generic type arguments; TypeScript will produce a type error if you attempt to do so.Methods and hooks automatically switch to modern signatures the moment any non-optional property is declared in
DeclareDefaultOptions. The switch happens across all methods and hooks globally:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { namespace ApolloClient { namespace DeclareDefaultOptions { interface WatchQuery { errorPolicy: "all"; // non-optional → modern signatures activated automatically } } } }Users can also manually switch to modern signatures without declaring any
defaultOptions, for example when wanting accurate type inference without relying on globaldefaultOptions:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { export interface TypeOverrides { signatureStyle: "modern"; } }Users can do a global
DeclareDefaultOptionstype augmentation and then manually switch back to "classic" for migration purposes:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { export interface TypeOverrides { signatureStyle: "classic"; } }Note that this is not recommended for long-term use. When combined with
DeclareDefaultOptions, switching back to classic results in the same incorrect types as before Apollo Client 4.2—methods and hooks will not reflect thedefaultOptionsyou've declared.Improve the accuracy of
client.queryreturn type to better detect the currenterrorPolicy. Thedataproperty is no longer nullable when theerrorPolicyisnone. This makes it possible to remove theundefinedchecks or optional chaining in most cases.Add support for automatic event-based refetching, such as window focus.
The
RefetchEventManagerclass handles automatic refetches in response to events. Apollo Client provides built-in sources for window focus and network reconnect aswindowFocusSourceandonlineSource.Event refetching is fully opt-in. Create and pass a
RefetchEventManagerinstance to theApolloClientconstructor to activate the event listeners.import { ApolloClient, InMemoryCache, RefetchEventManager, windowFocusSource, onlineSource, } from "@apollo/client"; const client = new ApolloClient({ link, cache: new InMemoryCache(), refetchEventManager: new RefetchEventManager({ sources: { // Refetch when window is focused windowFocus: windowFocusSource, // Refetch when the user comes back online online: onlineSource, }, }), });By default, all active queries refetch when the events fire. Queries can opt out per-event or disable all event refetches:
// Skip refetch on window focus for this query, but keep `online` useQuery(QUERY, { refetchOn: { windowFocus: false }, }); // Disable all event-driven refetches for this query useQuery(OTHER_QUERY, { refetchOn: false, }); // Enable every event for this query, regardless of defaultOptions useQuery(LIVE_DASHBOARD, { refetchOn: true, }); // Dynamically enable or disable a refetch when the event fires useQuery(LIVE_DASHBOARD, { refetchOn: ({ source, payload }) => { if (source === "windowFocus") { // payload is the data associated with the event return someCondition(payload); } return true; }, }); // Dynamically enable or disable a refetch for a specific event useQuery(LIVE_DASHBOARD, { refetchOn: { windowFocus: ({ payload }) => { // payload is the data associated with the event return someCondition(payload); }, }, });To enable per-query opt-in rather than opt-out, set
defaultOptions.watchQuery.refetchOntofalseand enable it per-query instead.const client = new ApolloClient({ link, cache, refetchEventManager: new RefetchEventManager({ sources: { windowFocus: windowFocusSource }, }), defaultOptions: { watchQuery: { refetchOn: false }, }, }); // Only this query refetches on window focus useQuery(DASHBOARD_QUERY, { refetchOn: { windowFocus: true } });When
defaultOptions.watchQuery.refetchOnand per-queryrefetchOnoptions are provided, the objects are merged together.
Custom events
You can also add your own custom events that trigger refetches. Register your event name and payload type using TypeScript module augmentation, then provide a source function that returns an Observable. The source's emitted value becomes the event's
payload.import { Observable } from "@apollo/client"; import { filter } from "rxjs"; import { AppState, AppStateStatus, Platform } from "react-native"; declare module "@apollo/client" { interface RefetchEvents { reactNativeAppStatus: AppStateStatus; } } const refetchEventManager = new RefetchEventManager({ sources: { reactNativeAppStatus: () => { return new Observable((observer) => { const subscription = AppState.addEventListener("change", (status) => { observer.next(status); }); return () => subscription.remove(); }).pipe( filter((status) => Platform.OS !== "web" && status === "active") ); }, }, }); // Disable per-query by setting the event to false useQuery(QUERY, { refetchOn: { reactNativeAppStatus: false } });Manually trigger an event refetch
Refetches can be triggered imperatively by calling
emitwith the event name and its payload (if any).refetchEventManager.emit("reactNativeAppStatus", "active");Sourceless events
A source that has no automatic detection logic but still wants imperative
emitsupport can be declared astrue. Type the event asvoidto omit the payload argument.declare module "@apollo/client" { interface RefetchEvents { userTriggered: void; } } const refetchEventManager = new RefetchEventManager({ sources: { userTriggered: true }, }); refetchEventManager.emit("userTriggered");Note: Calling
emiton an event without a registered source will log a warning and result in a no-op.Custom handlers
When an event fires, the default handler calls
client.refetchQueries({ include: "active" })filtered by each query'srefetchOnsetting. You can override the handler for an event to add your own custom filtering. For example, to refetch all queries, includingstandbyqueries, define a handler for the event:const refetchEventManager = new RefetchEventManager({ // ... handlers: { userTriggered: ({ client, source, payload, matchesRefetchOn }) => { return client.refetchQueries({ include: "all", onQueryUpdated: (observableQuery) => { return matchesRefetchOn(observableQuery); }, }); }, }, });Handlers must return either a
RefetchQueriesResultorvoid. Returningvoidskips refetching for the event.Version bump to
rc.Extend the
defaultOptionstype-safety work toclient.mutateanduseMutation.The
errorPolicyoption now flows through to the result types for mutations in the same way it already does for queries:ApolloClient.MutateResult<TData, TErrorPolicy>mapserrorPolicyto the concrete shape ofdataanderror:"none"→{ data: TData; error?: never }"all"→{ data: TData | undefined; error?: ErrorLike }"ignore"→{ data: TData | undefined; error?: never }
client.mutateanduseMutationpick up the declareddefaultOptions.mutate.errorPolicyand the expliciterrorPolicyon each call to narrow return types accordingly.useMutation.Result.erroris narrowed toundefinedwhenerrorPolicyis"ignore", sinceclient.mutatenever resolves with an error in that case.
DeclareDefaultOptions.Mutatealready acceptederrorPolicy; the new behavior is that once you declare it, hook and method return types reflect it:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { namespace ApolloClient { namespace DeclareDefaultOptions { interface Mutate { errorPolicy: "all"; } } } }const result = await client.mutate({ mutation: MUTATION }); result.data; // ^? TData | undefined result.error; // ^? ErrorLike | undefinedSetting
errorPolicyon an individual call overrides the default for that call's return type.Extend the
defaultOptionstype-safety work topreloadQuery(returned fromcreateQueryPreloader). Defaults declared inDeclareDefaultOptions.WatchQuerynow work withpreloadQueryto ensure thePreloadedQueryRef's data states are correctly set.// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { namespace ApolloClient { namespace DeclareDefaultOptions { interface WatchQuery { errorPolicy: "all"; } } } }const preloadQuery = createQueryPreloader(client); const queryRef = preloadQuery(QUERY); // ^? PreloadedQueryRef<TData, TVariables, "complete" | "streaming" | "empty">
Synchronize method and hook return types with
defaultOptions.Prior to this change, the following code snippet would always apply:
declare const MY_QUERY: TypedDocumentNode<TData, TVariables>; const result1 = useSuspenseQuery(MY_QUERY); result1.data; // ^? TData const result2 = useSuspenseQuery(MY_QUERY, { errorPolicy: "all" }); result2.data; // ^? TData | undefinedWhile these types are generally correct, if you were to set
errorPolicy: 'all'as a default option, the type ofresult.datafor the first query would remainTDatainstead of changing toTData | undefinedto match the runtime behavior.We are now enforcing that certain
defaultOptionstypes need to be registered globally. This means that if you want to useerrorPolicy: 'all'as a default option for a query, you will need to register its type like this:// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { namespace ApolloClient { namespace DeclareDefaultOptions { interface WatchQuery { // possible global-registered values: // * `errorPolicy` // * `returnPartialData` errorPolicy: "all"; } interface Query { // possible global-registered values: // * `errorPolicy` } interface Mutate { // possible global-registered values: // * `errorPolicy` } } } }Once this type declaration is in place, the type of
result.datain the above example will correctly be changed toTData | undefined, reflecting the possibility that if an error occurs,datamight beundefined. Manually specifyinguseSuspenseQuery(MY_QUERY, { errorPolicy: "none" });changesresult.datatoTDatato reflect the local override.This change means that you will need to declare your default options types in order to use
defaultOptionswithApolloClient, otherwise you will see a TypeScript error.Without the type declaration, the following (previously valid) code will now error:
new ApolloClient({ link: ApolloLink.empty(), cache: new InMemoryCache(), defaultOptions: { watchQuery: { // results in a type error: // Type '"all"' is not assignable to type '"A default option for watchQuery.errorPolicy must be declared in ApolloClient.DeclareDefaultOptions before usage. See https://www.apollographql.com/docs/react/data/typescript#declaring-default-options-for-type-safety."'. errorPolicy: "all", }, }, });If you are creating multiple instances of Apollo Client with conflicting default options and you cannot register a single
defaultOptionsvalue as a result, you can relax the constraints by declaring those options as union types covering all values used by all clients. The properties can be required (to enforce them indefaultOptions) or optional (if some constructor calls won't pass a value):// apollo.d.ts import "@apollo/client"; declare module "@apollo/client" { export namespace ApolloClient { export namespace DeclareDefaultOptions { interface WatchQuery { errorPolicy?: "none" | "all" | "ignore"; returnPartialData?: boolean; } interface Query { errorPolicy?: "none" | "all" | "ignore"; } interface Mutate { errorPolicy?: "none" | "all" | "ignore"; } } } }With this declaration, the
ApolloClientconstructor accepts any of those values indefaultOptions. The tradeoff is that hook and method return types become more generic. For example, callinguseSuspenseQuerywithout an expliciterrorPolicywill return a result typed as if all error policies are possible, since TypeScript can't know which specific value your instance uses at runtime.Note that making a property optional (
errorPolicy?:) is equivalent to adding the TypeScript default value ("none") to the union. SoerrorPolicy?: "all" | "ignore"has the same effect on return types aserrorPolicy: "none" | "all" | "ignore", because TypeScript assumes the option could also be absent (i.e.,"none").You can also use a partial union that only lists the values you actually use. For example, if you only ever use
"all"or"ignore", declareerrorPolicy: "all" | "ignore"(required) to keep the union narrow and avoid unused values broadening your signatures unnecessarily.
Patch Changes
Fix the deprecation for the classic signatures for function overloads that rely on type inference from a
TypedDocumentNode. The deprecation now only applies to classic signatures that provide explicit type arguments to encourage the use ofTypedDocumentNode.Release changes in 4.1.5 and 4.1.6.
Ensure the options object for the
useQuery,useSuspenseQuery, anduseBackgroundQueryhooks provide proper IntelliSense suggestions.Fix
refetchOnmerging whendefaultOptions.watchQuery.refetchOnis set to a non-object value (false,true, or a function) and the per-queryrefetchOnis an object. Previously the per-query object completely replaced the default so unspecified events fell back to "enabled" regardless of the default.The
defaultOptionsvalue now applies to any event the per-query object does not explicitly configure:false- unspecified events stay disabledtrue- unspecified events refetchCallback function - the function is called for unspecified events to determine whether to refetch
const client = new ApolloClient({ // ... defaultOptions: { watchQuery: { refetchOn: false, }, }, }); // Only `windowFocus` refetches. Other events stay disabled per the default. useQuery(QUERY, { refetchOn: { windowFocus: true } });Add the ability to override the default event handler on
RefetchEventManager. The default handler runs when no per-source handler is configured for an event. Provide a custom handler via thedefaultHandlerconstructor option or thesetDefaultEventHandlerinstance method.new RefetchEventManager({ defaultHandler: ({ client, matchesRefetchOn }) => { return client.refetchQueries({ include: "all", onQueryUpdated: matchesRefetchOn, }); }, });
4.1.9
23 Apr 2026Remove the
workspacesfield from the publishedpackage.jsonindistto avoid Yarn v1 warnings about workspaces requiring private packages.
4.1.8
23 Apr 2026Ship agent skill for usage with @tanstack/intent — the skill is now bundled in the npm package under
skills/apollo-client/and discoverable byintent list. For more context, see the TanStack Intent QuickStart.
4.1.7
8 Apr 2026Fix RxJS interop issue with the observable returned by
WebSocketLink.
4.1.6
23 Feb 2026Fix
useQueryhydration mismatch whenssr: falseandskip: trueare used togetherWhen both options were combined, the server would return
loading: false(becauseuseSSRQuerychecksskipfirst), but the client'sgetServerSnapshotwas returningssrDisabledResultwithloading: true, causing a hydration mismatch.
4.1.5
19 Feb 2026Fix an issue where
useQuerywould poll withpollIntervalwhenskipwas initialized totrue.Fix issue where
client.querywould apply options fromdefaultOptions.watchQuery.
4.1.4
5 Feb 2026Ensure
PersistedQueryLinkmergeshttpandfetchOptionscontext values instead of overwriting them.
4.1.3
28 Jan 2026Fix
createFetchMultipartSubscriptionto support cancellation viaAbortControllerPreviously, calling
dispose()orunsubscribe()on a subscription created bycreateFetchMultipartSubscriptionhad no effect - the underlying fetch request would continue running until completion. This was because noAbortControllerwas created or passed tofetch(), and no cleanup function was returned from the Observable.
4.1.2
21 Jan 2026ssrMode,ssrForceFetchDelayorprioritizeCacheValuesshould not overridefetchPolicy: 'cache-only',fetchPolicy: 'no-cache',fetchPolicy: 'standby',skip: true, orskipTokenwhen reading the initial value of anObservableQuery.Fix
skipTokeninuseQuerywithprerenderStaticand related SSR functions.Avoid fetches with
fetchPolicy: no-cacheinuseQuerywithprerenderStaticand related SSR functions.
4.1.1
20 Jan 2026Ensure
@clientfields that are children of aliased server fields are resolved correctly.
4.1.0
15 Jan 2026Support
headerstransport for enhanced client awareness.You can now provide a callback function as the
contextoption on themutatefunction returned byuseMutation. The callback function is called with the value of thecontextoption provided to theuseMutationhook. This is useful if you'd like to merge the context object provided to theuseMutationhook with a value provided to themutatefunction.function MyComponent() { const [mutate, result] = useMutation(MUTATION, { context: { foo: true }, }); async function runMutation() { await mutate({ // sends context as { foo: true, bar: true } context: (hookContext) => ({ ...hookContext, bar: true }), }); } // ... }Fix an issue where deferred payloads that returned arrays with fewer items than the original cached array would retain items from the cached array. This change includes
@streamarrays where stream arrays replace the cached arrays.
Minor Changes
Support
headerstransport for enhanced client awareness.You can now provide a callback function as the
contextoption on themutatefunction returned byuseMutation. The callback function is called with the value of thecontextoption provided to theuseMutationhook. This is useful if you'd like to merge the context object provided to theuseMutationhook with a value provided to themutatefunction.function MyComponent() { const [mutate, result] = useMutation(MUTATION, { context: { foo: true }, }); async function runMutation() { await mutate({ // sends context as { foo: true, bar: true } context: (hookContext) => ({ ...hookContext, bar: true }), }); } // ... }Fix an issue where deferred payloads that returned arrays with fewer items than the original cached array would retain items from the cached array. This change includes
@streamarrays where stream arrays replace the cached arrays.Don't set the fallback value of a
@clientfield tonullwhen areadfunction is defined. Instead thereadfunction will be called with anexistingvalue ofundefinedto allow default arguments to be used to set the returned value.When a
readfunction is not defined nor is there a defined resolver for the field, warn and set the value tonullonly in that instance.Add support for
from: nullinclient.watchFragmentandcache.watchFragment. Whenfromisnull, the emitted result is:{ data: null, dataState: "complete", complete: true, }Support the newer incremental delivery format for the
@deferdirective implemented ingraphql@17.0.0-alpha.9. Import theGraphQL17Alpha9Handlerto use the newer incremental delivery format with@defer.import { GraphQL17Alpha9Handler } from "@apollo/client/incremental"; const client = new ApolloClient({ // ... incrementalHandler: new GraphQL17Alpha9Handler(), });Note
In order to use the
GraphQL17Alpha9Handler, the GraphQL server MUST implement the newer incremental delivery format. You may see errors or unusual behavior if you use the wrong handler. If you are using Apollo Router, continue to use theDefer20220824Handlerbecause Apollo Router does not yet support the newer incremental delivery format.Add support for arrays with
useFragment,useSuspenseFragment, andclient.watchFragment. This allows the ability to use a fragment to watch multiple entities in the cache. Passing an array tofromwill returndataas an array where each array index corresponds to the index in thefromarray.function MyComponent() { const result = useFragment({ fragment, from: [item1, item2, item3], }); // `data` is an array with 3 items console.log(result); // { data: [{...}, {...}, {...}], dataState: "complete", complete: true } }Add a
getCurrentResultfunction to the observable returned byclient.watchFragmentandcache.watchFragmentthat returns the current value for the watched fragment.const observable = client.watchFragment({ fragment, from: { __typename: "Item", id: 1 }, }); console.log(observable.getCurrentResult()); // { // data: {...}, // dataState: "complete", // complete: true, // }Add the
fromoption toreadFragment,watchFragment, andupdateFragment.Add support for the
@streamdirective on both theDefer20220824Handlerand theGraphQL17Alpha2Handler.Note
The implementations of
@streamdiffer in the delivery of incremental results between the different GraphQL spec versions. If you upgrading from the older format to the newer format, expect the timing of some incremental results to change.InMemoryCacheno longer filters out explicitly returnedundefineditems fromreadfunctions for array fields. This now makes it possible to createreadfunctions on array fields that return partial data and trigger a fetch for the full list.Add an
extensionsoption tocache.write,cache.writeQuery, andclient.writeQuery. This makesextensionsavailable in cachemergefunctions which can be accessed with the other merge function options.As a result of this change, any
extensionsreturned in GraphQL operations are now available inmergein the cache writes for these operations.Add an abstract
resolvesClientFieldfunction toApolloCachethat can be used by caches to tellLocalStateif it can resolve a@clientfield when a local resolver is not defined.LocalStatewill emit a warning and set a fallback value ofnullwhen no local resolver is defined andresolvesClientFieldreturnsfalse, or isn't defined. ReturningtruefromresolvesClientFieldsignals that a mechanism in the cache will set the field value. In this case,LocalStatewon't set the field value.Use the default stream merge function for
@streamfields only if stream info is present. This change means that using the olderDefer20220824Handlerwill not use the default stream merge function and will instead truncate the streamed array on the first chunk.
Patch Changes
Ensure that
PreloadedQueryRefinstances are unsubscribed when garbage collectedChange the returned value from
nullto{}when all fields in a query were skipped.This also fixes a bug where
useSuspenseQuerywould suspend indefinitely when all fields were skipped.Fix an issue where errors parsed from incremental chunks in
ErrorLinkmight throw when using theGraphQL17Alpha9Handler.Deduplicate watches created by
useFragment,client.watchFragment, andcache.watchFragmentthat contain the same fragment, variables, and identifier. This should improve performance in situations where auseFragmentor aclient.watchFragmentis used to watch the same object in multiple places of an application.Allow
FragmentTypenot only to be called asFragmentType<TData>, but also asFragmentType<TypedDocumentNode>.Fix an issue where calling
fetchMorewith@deferor@streamwould not rerender incremental results as they were streamed.Truncate
@streamarrays only on last chunk by default.Expose the
ExtensionsWithStreamInfotype forextensionsinCache.writeQuery,Cache.writeandCache.updateso other cache implementations also can correctly access them.Improve the cache data loss warning message when
existingorincomingis an array.Ignore top-level
datavalues on subsequent chunks in incremental responses.Create mechanism to add experimental features to Apollo Client
Ensure
LocalStatedoesn't try to read from the cache when using ano-cachefetch policy.Ensure an error is thrown when
@streamis detected and anincrementalDeliveryhandler is not configured.Use memoized observable mapping when using
watchFragment,useFragmentoruseSuspenseFragment.Add helper type
QueryRef.ForQuery<TypedDocumentNode>Pass
streamInfothrough result extensions as aWeakRef.Fix the
Defer20220824Handler.SubsequentResulttype to match theFormattedSubsequentIncrementalExecutionResulttype ingraphql@17.0.0-alpha.2.Warn when using a
no-cachefetch policy without a local resolver defined.no-cachequeries do not read or write to the cache which meantno-cachequeries are silently incomplete when the@clientfield value was handled by a cachereadfunction.Update the
acceptheader used with theGraphQL17Alpha9Handlertomultipart/mixed;incrementalSpec=v0.2to ensure the newest incremental delivery format is requested.DeepPartial<Array<TData>>now returnsArray<DeepPartial<TData>>instead ofArray<DeepPartial<TData | undefined>>.prerenderStatic: Expose return value ofrenderFunctionto userland, fixabortedproperty.This enables usage of
resumeAndPrerenderwith React 19.2.Reduce the number of observables created by
watchFragmentby reusing existing observables as much as possible. This should improve performance when watching the same item in the cache multiple times after a cache update occurs.Handle
@streampayloads that send multiple items in the same chunk when using theDefer20220824Handler.Handle an edge case with the
Defer20220824Handlerwhere an error for a@streamitem that bubbles to the@streamboundary (such as an item returningnullfor a non-null array item) would write items from future chunks to the wrong array index. In these cases, the@streamfield is no longer processed and future updates to the field are ignored. This prevents runtime errors that TypeScript would otherwise not be able to catch.Avoid calling
mergefunctions more than once for the same incremental chunk.
4.0.13
13 Jan 2026Ensure that
compactandmergeOptionspreserve symbol keys.This fixes an issue where the change introduced in 4.0.11 via #13049 would not be applied if
defaultOptionsforwatchQuerywere declared.Please note that
compactandmergeOptionsare considered internal utilities and they might have similar behavior changes in future releases. Do not use them in your application code - a change like this is not considered breaking and will not be announced as such.
4.0.12
12 Jan 2026Reading the note…
4.0.11
16 Dec 2025Reading the note…
4.0.10
10 Dec 2025Reading the note…
4.0.9
31 Oct 2025Reading the note…
4.0.8
27 Oct 2025Reading the note…
4.0.7
30 Sep 2025Reading the note…
4.0.6
25 Sep 2025Reading the note…
4.0.5
12 Sep 2025Reading the note…
4.0.4
2 Sep 2025Reading the note…
4.0.3
29 Aug 2025Reading the note…
4.0.2
27 Aug 2025Reading the note…
4.0.1
25 Aug 2025Reading the note…
4.0.0
21 Aug 2025Reading the note…
- 3.x
3.14.1
12 Mar 2026Reading the note…
3.14.0
21 Aug 2025Reading the note…
3.13.9
29 Jul 2025Reading the note…
3.13.8
17 Apr 2025Reading the note…
3.13.7
10 Apr 2025Reading the note…
3.13.6
4 Apr 2025Reading the note…
3.13.5
20 Mar 2025Reading the note…