NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4032 most downloaded on npm
A fully-featured caching GraphQL client.
Last release 14 days ago
18 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
27 versions withdrawn
withdrawn after publishing
7 years old
727 releases · first in 2019
Fix useLazyQuery forceUpdate loop regression introduced by #7655 in version 3.3.10. @benjamn in #7715
Revert PR #7276, but test that garbage collection reclaims torn-down ObservableQuery objects. @benjamn in #7695
Revert PR #7276, but test that garbage collection reclaims torn-down ObservableQuery objects. <br/>
@benjamn in #7695
Reset QueryInfo.diff and QueryInfo.dirty after canceling notify timeout in QueryInfo.markResult and QueryInfo.markError. <br/>
@jcreighton in #7696
Avoid calling forceUpdate when component is unmounted. <br/>
@DylanVann in #7655
The codemods/ top-level directory has been moved into the scripts/ directory. <br/>
@benjamn in #7675
One column per quarter.
Prevent reactive variables from retaining otherwise unreachable InMemoryCache objects. @benjamn in #7661
InMemoryCache objects. <br/>
@benjamn in #7661graphql-tag dependency has been updated to version 2.12.0, after converting its repository to use TypeScript and ECMAScript module syntax. There should be no visible changes in behavior, though the internal changes seemed significant enough to mention here. <br/>
@abdonrd in graphql-tag#273 and
@PowerKiKi in graphql-tag#325Catch updates in useReactiveVar with an additional check. @jcreighton in #7652
Catch updates in useReactiveVar with an additional check. <br/>
@jcreighton in #7652
Reactivate forgotten reactive variables whenever InMemoryCache acquires its first watcher. <br/>
@benjamn in #7657
Backport Symbol.species fix for Concast and ObservableQuery from release-3.4, fixing subscriptions in React Native Android when the Hermes JavaScript engine is enabled (among other benefits). <br/>
@benjamn in #7403 and #7660
Fix a regression due to #7310 that caused loading always to be true for skip: true results during server-side rendering. @rgrove in #7567
Fix a regression due to #7310 that caused loading always to be true for skip: true results during server-side rendering. <br/>
@rgrove in #7567
Avoid duplicate useReactiveVar listeners when rendering in React.StrictMode. <br/>
@jcreighton in #7581
displayName on ApolloContext objects for easier debugging. <br/>
@dulmandakh in #7550Immediately apply queryType: true, mutationType: true, and subscriptionType: true type policies, rather than waiting for the first time the policy is
Immediately apply queryType: true, mutationType: true, and subscriptionType: true type policies, rather than waiting for the first time the policy is used, fixing a regression introduced by #7065. <br/>
@benjamn in #7463
Check that window is defined even when connectToDevTools is true. <br/>
@yasupeke in #7434
Restore client.version property, reflecting the current @apollo/client version from package.json. @benjamn in #7448
Update ts-invariant to avoid potential Content Security Policy-violating Function fallback, thanks to a clever new `globalThis` polyfill technique. @b
ts-invariant to avoid potential Content Security Policy-violating Function fallback, thanks to a clever new globalThis polyfill technique. <br/>
@benjamn in #7414Make the observer parameter of ApolloLink#onError optional, fixing an unnecessary breaking change for any code that called onError directly. @benjamn…
> ⚠️ Note: This version of @apollo/client contains no behavioral changes since version 3.3.1
⚠️ Note: This version of
@apollo/clientcontains no behavioral changes since version 3.3.1
The Pagination article has been completely rewritten (and split into multiple pages) to cover Apollo Client 3 field policies. <br/> @benjamn and @StephenBarlow in #7175
Revamp local state tutorial chapter for Apollo Client 3, including reactive variables. <br/>
@StephenBarlow in apollographql@apollo#1050
Add examples of using ApolloLink to modify response data asynchronously. <br/>
@alichry in #7332
Consolidate separate v2.4, v2.5, and v2.6 documentation versions into one v2 version. <br/> @jgarrow in #7378
Revert back to default-importing React internally, rather than using a namespace import. @benjamn in 113475b1
Update @wry/equality to consider undefined properties equivalent to missing properties. @benjamn in #7108
Update @wry/equality to consider undefined properties equivalent to missing properties.
@benjamn in #7108
Prevent memory leaks involving unused onBroadcast function closure created in ApolloClient constructor.
@kamilkisiela in #7161
Provide default empty cache object for root IDs like ROOT_QUERY, to avoid differences in behavior before/after ROOT_QUERY data has been written into InMemoryCache.
@benjamn in #7100
Cancel queryInfo.notifyTimeout in QueryInfo#markResult to prevent unnecessary network requests when using a FetchPolicy of cache-and-network or network-only in a React component with multiple useQuery calls.
@benjamn in #7347
Ensure cache.readQuery and cache.readFragment always return TData | null, instead of throwing MissingFieldError exceptions when missing fields are encountered.
@benjamn in #7098
Since this change converts prior exceptions to
nullreturns, and sincenullwas already a possible return value according to theTData | nullreturn type, we are confident this change will be backwards compatible (as long asnullwas properly handled before).
HttpLink will now automatically strip any unused variables before sending queries to the GraphQL server, since those queries are very likely to fail validation, according to the All Variables Used rule in the GraphQL specification. If you depend on the preservation of unused variables, you can restore the previous behavior by passing includeUnusedVariables: true to the HttpLink constructor (which is typically passed as options.link to the ApolloClient constructor).
@benjamn in #7127
Ensure MockLink (used by MockedProvider) returns mock configuration errors (e.g. No more mocked responses for the query ...) through the Link's Observable, instead of throwing them. These errors are now available through the error property of a result.
@hwillson in #7110
Returning mock configuration errors through the Link's
Observablewas the default behavior in Apollo Client 2.x. We changed it for 3, but the change has been problematic for those looking to migrate from 2.x to 3. We've decided to change this back with the understanding that not many people want or are relying onMockLink's throwing exception approach. If you want to change this functionality, you can define custom error handling throughMockLink.setOnError.
Unsubscribing the last observer from an ObservableQuery will once again unsubscribe from the underlying network Observable in all cases, as in Apollo Client 2.x, allowing network requests to be cancelled by unsubscribing.
@javier-garcia-meteologica in #7165 and #7170.
The independent QueryBaseOptions and ModifiableWatchQueryOptions interface supertypes have been eliminated, and their fields are now defined by QueryOptions.
@DCtheTall in #7136
Internally, Apollo Client now avoids nested imports from the graphql package, importing everything from the top-level package instead. For example,
import { visit } from "graphql/language/visitor"
is now just
import { visit } from "graphql"
Since the graphql package uses .mjs modules, your bundler may need to be configured to recognize .mjs files as ECMAScript modules rather than CommonJS modules.
@benjamn in #7185
Support inheritance of type and field policies, according to possibleTypes.
@benjamn in #7065
Allow configuring custom merge functions, including the merge: true and merge: false shorthands, in type policies as well as field policies.
@benjamn in #7070
The verbosity of Apollo Client console messages can be globally adjusted using the setLogVerbosity function:
import { setLogVerbosity } from "@apollo/client";
setLogVerbosity("log"); // display all messages
setLogVerbosity("warn"); // display only warnings and errors (default)
setLogVerbosity("error"); // display only errors
setLogVerbosity("silent"); // hide all console messages
Remember that all logs, warnings, and errors are hidden in production. @benjamn in #7226
Modifying InMemoryCache fields that have keyArgs configured will now invalidate only the field value with matching key arguments, rather than invalidating all field values that share the same field name. If keyArgs has not been configured, the cache must err on the side of invalidating by field name, as before.
@benjamn in #7351
Shallow-merge options.variables when combining existing or default options with newly-provided options, so new variables do not completely overwrite existing variables.
@amannn in #6927
Avoid displaying Cache data may be lost... warnings for scalar field values that happen to be objects, such as JSON data.
@benjamn in #7075
In addition to the result.data property, useQuery and useLazyQuery will now provide a result.previousData property, which can be useful when a network request is pending and result.data is undefined, since result.previousData can be rendered instead of rendering an empty/loading state.
@hwillson in #7082
Passing validate: true to the SchemaLink constructor will enable validation of incoming queries against the local schema before execution, returning validation errors in result.errors, just like a non-local GraphQL endpoint typically would.
@amannn in #7094
Allow optional arguments in keyArgs: [...] arrays for InMemoryCache field policies.
@benjamn in #7109
Avoid registering QueryPromise when skip is true during server-side rendering.
@izumin5210 in #7310
ApolloCache objects (including InMemoryCache) may now be associated with or disassociated from individual reactive variables by calling reactiveVar.attachCache(cache) and/or reactiveVar.forgetCache(cache).
@benjamn in #7350
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Revert back to default-importing React internally, rather than using a namespace import. @benjamn in 113475b1
Ensure sourcesContent array is properly defined in .js.map files generated by tsc. @benjamn in #7371
Revert updating symbol-observable from version 2.x to version 3, which caused TypeScript errors with some @types/node versions, especially in Angular
Always consider singleton IDs like ROOT_QUERY and ROOT_MUTATION to be root IDs during cache.gc garbage collection, regardless of whether they have bee
Always consider singleton IDs like ROOT_QUERY and ROOT_MUTATION to be root IDs during cache.gc garbage collection, regardless of whether they have been retained or released. <br/>
@benjamn in #7333
Use optional chaining syntax (this.currentObservable?.refetch) in React refetch wrapper function to avoid crashing when an unmounted component is accidentally refetched. <br/>
@tm1000 in #6314 and
@linmic in #7186
Handle older react-apollo package in codemods/ac2-to-ac3/imports.js migration script. <br/>
@tm1000 in #7216
Ensure relayStylePagination preserves pageInfo.{start,end}Cursor if edges is missing or empty. <br/>
@beaucollins in #7224
Move terser dependency from dependencies to devDependencies. @SimenB in #7188
Move terser dependency from dependencies to devDependencies. <br/>
@SimenB in #7188
Avoid all sub-package imports from the graphql npm package. <br/>
@stoically in #7185
Update the optimism npm dependency to version 0.13.0 in order to use the new optimistic.forget method to fix a potential cache.watch memory leak. @ben
Update the optimism npm dependency to version 0.13.0 in order to use the new optimistic.forget method to fix a potential cache.watch memory leak. <br/>
@benjamn in #7157
Consider cache.reset a destructive method, like cache.evict and cache.modify. <br/>
@joshjg in #7150
Avoid refetching observerless queries with reFetchObservableQueries. <br/>
@joshjg in #7146
Default args.offset to zero in offsetLimitPagination. @benjamn in #7141
Undo TEdgeWrapper approach for relayStylePagination, introduced by f41e9efc in #7023, since it was an unintended breaking change for existing code tha…
Fix relayStylePagination to handle the possibility that edges might be normalized Reference objects (uncommon). @anark and @benjamn in #7023
Fix relayStylePagination to handle the possibility that edges might be normalized Reference objects (uncommon). <br/>
@anark and @benjamn in #7023
Disable "Missing cache result fields" warnings when returnPartialData is true. <br/>
@hwillson in #7055
subscriptions-transport-ws peerDependency as optional. <br/>
@MasterOdin in #7047Use options.nextFetchPolicy internally to restore original FetchPolicy after polling with fetchPolicy: "network-only", so that polling does not interf
Use options.nextFetchPolicy internally to restore original FetchPolicy after polling with fetchPolicy: "network-only", so that polling does not interfere with normal query watching.
@benjamn in #6893
Initialize ObservableQuery in updateObservableQuery even if skip is true.
@mu29 in #6999
Prevent full reobservation of queries affected by optimistic mutation updates, while still delivering results from the cache. @benjamn in #6854
In TypeScript, all APIs that take DocumentNode parameters now may alternatively take TypeDocumentNode<Data, Variables>. This type has the same JavaScript representation but allows the APIs to infer the data and variable types instead of requiring you to specify types explicitly at the call site.
@dotansimha in #6720
Bring back an improved form of heuristic fragment matching, by allowing possibleTypes to specify subtype regular expression strings, which count as matches if the written result object has all the fields expected for the fragment.
@benjamn in #6901
Allow options.nextFetchPolicy to be a function that takes the current FetchPolicy and returns a new (or the same) FetchPolicy, making nextFetchPolicy more suitable for global use in defaultOptions.watchQuery.
@benjamn in #6893
Implement useReactiveVar hook for consuming reactive variables in React components.
@benjamn in #6867
Move apollo-link-persisted-queries implementation to @apollo/client/link/persisted-queries. Try running our automated imports transform to handle this conversion, if you're using apollo-link-persisted-queries.
@hwillson in #6837
Disable feud-stopping logic after any cache.evict or cache.modify operation.
@benjamn in
#6817 and
#6898
Throw if writeFragment cannot identify options.data when no options.id provided.
@jcreighton in #6859
Provide options.storage object to cache.modify functions, as provided to read and merge functions.
@benjamn in #6991
Allow cache.modify functions to return details.INVALIDATE (similar to details.DELETE) to invalidate the current field, causing affected queries to rerun, even if the field's value is unchanged.
@benjamn in #6991
Support non-default ErrorPolicy values (that is, "ignore" and "all", in addition to the default value "none") for mutations and subscriptions, like we do for queries.
@benjamn in #7003
Remove invariant forbidding a FetchPolicy of cache-only in ObservableQuery#refetch.
@benjamn in ccb0a79a, fixing #6702
Restrict root object identification to ROOT_QUERY (the ID corresponding to the root Query object), allowing Mutation and Subscription as user-defined types.
@benjamn in #6914
Prevent crash when pageInfo and empty edges are received by relayStylePagination.
@fracmak in #6918
result.data (rather than all properties of result) when settling cache feuds.
@danReynolds in #6777import declarations to use Apollo Client 3.x packages. Instructions.
@dminkovsky and @jcreighton in #6486Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →