@apollo/client
4.3.5 · 19 Oct 2026MIT5.3M / weekRepositoryHomepagenpmAtom feed
3.14.1 is the newest release of 3.x.
In short
2 deprecated3 new4 fixed
- deprecated
Deprecate the
onCompletedandonErrorcallbacks ofuseQueryanduseLazyQuery. - deprecated
Deprecate option
ignoreResultsinuseMutation.
Release note
Minor Changes
Adds a new
useSuspenseFragmenthook.useSuspenseFragmentsuspends untildatais complete. It is a drop-in replacement foruseFragmentwhen you prefer to use Suspense to control the loading state of a fragment. See the documentation for more details.Ensure errors thrown in the
onCompletedcallback fromuseMutationdon't callonError.- deprecated
Deprecate the
onCompletedandonErrorcallbacks ofuseQueryanduseLazyQuery.
For more context, please see the related issue on GitHub. Provide a more type-safe option for the previous data value passed to
observableQuery.updateQuery. Using it could result in crashes at runtime as this callback could be called with partial data even though its type reported the value as a complete result.The
updateQuerycallback function is now called with a new type-safepreviousDataproperty and a newcompleteproperty in the 2nd argument that determines whetherpreviousDatais a complete or partial result.As a result of this change, it is recommended to use the
previousDataproperty passed to the 2nd argument of the callback rather than using the previous data value from the first argument since that value is not type-safe. The first argument is now deprecated and will be removed in a future version of Apollo Client.observableQuery.updateQuery( (unsafePreviousData, { previousData, complete }) => { previousData; // ^? TData | DeepPartial<TData> | undefined if (complete) { previousData; // ^? TData } else { previousData; // ^? DeepPartial<TData> | undefined } } );Reject the mutation promise if errors are thrown in the
onCompletedcallback ofuseMutation.
Patch Changes
Fix the return type of the
updateQueryfunction to allow forundefined.updateQueryhad the ability to bail out of the update by returning a falsey value, but the return type enforced a query value.observableQuery.updateQuery( (unsafePreviousData, { previousData, complete }) => { if (!complete) { // Bail out of the update by returning early return; } // ... } );- deprecated
Deprecate option
ignoreResultsinuseMutation.
Once this option is removed, existing code still using it might see increase in re-renders.
If you don't want to synchronize your component state with the mutation, please useuseApolloClientto get your ApolloClient instance and callclient.mutatedirectly. In case of a multipart response (e.g. with
@defer), query deduplication will
now keep going until the final chunk has been received.Fix the type of the
variablesproperty passed as the 2nd argument to thesubscribeToMorecallback. This was previously reported as thevariablestype for the subscription itself, but is now properly typed as the queryvariables.