A fully-featured caching GraphQL client.
Last release 6 days ago
21 Aug 2026
Ships on a steady schedule
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
723 releases · first in 2019
Release timeline
723 releases since 2019Releases
- 3.1.0-pre.124 Jul 2020pre-release
Nothing published for this version
- 3.1.0-pre.023 Jul 2020pre-release
Nothing published for this version
- 3.0.216 Jul 2020
- 3.0.115 Jul 2020
Release notes2 sources agree
Open source →Bug Fixes
-
Make sure
useQueryonCompletedis not fired whenskipistrue. <br/> @hwillson in #6589 -
Revert changes to
peerDependenciesinpackage.json(#6594), which would have allowed using incompatible future versions ofgraphqland/orreactdue to overly-permissive>=version constraints. <br/> @hwillson in #6605
Apollo Client 3.0.0
-
- 3.0.014 Jul 2020
Release notes
Open source →Apollo Client 3.0.0
Improvements
⚠️ Note: As of 3.0.0, Apollo Client uses a new package name:
@apollo/clientApolloClient-
[BREAKING]
ApolloClientis now only available as a named export. The defaultApolloClientexport has been removed. @hwillson in #5425 -
[BREAKING] The
queryManagerproperty ofApolloClientinstances is now marked asprivate, paving the way for a more aggressive redesign of its API. -
[BREAKING] Apollo Client will no longer deliver "stale" results to
ObservableQueryconsumers, but will instead log more helpful errors about which cache fields were missing. @benjamn in #6058 -
[BREAKING]
ApolloError's thrown by Apollo Client no longer prefix error messages withGraphQL error:orNetwork error:. To differentiate between GraphQL/network errors, refer toApolloError's publicgraphQLErrorsandnetworkErrorproperties. @lorensr in #3892 -
[BREAKING] Support for the
@livedirective has been removed, but might be restored in the future if a more thorough implementation is proposed. @benjamn in #6221 -
[BREAKING] Apollo Client 2.x allowed
@clientfields to be passed into thelinkchain ifresolverswere not set in the constructor. This allowed@clientfields to be passed into Links likeapollo-link-state. Apollo Client 3 enforces that@clientfields are local only, meaning they are no longer passed into thelinkchain, under any circumstances.
@hwillson in #5982 -
[BREAKING?] Refactor
QueryManagerto make better use of observables and enforcefetchPolicymore reliably. @benjamn in #6221 -
The
updateQueryfunction previously required byfetchMorehas been deprecated with a warning, and will be removed in the next major version of Apollo Client. Please consider using amergefunction to handle incoming data instead of relying onupdateQuery. @benjamn in #6464 -
Helper functions for generating common pagination-related field policies may be imported from
@apollo/client/utilities. The most basic helper isconcatPagination, which emulates the concatenation behavior of typicalupdateQueryfunctions. A more sophisticated helper isoffsetLimitPagination, which implements offset/limit-based pagination. If you are consuming paginated data from a Relay-friendly API, userelayStylePagination. Feel free to use these helper functions as inspiration for your own field policies, and/or modify them to suit your needs. @benjamn in #6465 -
Updated to work with
graphql@15.
@durchanek in #6194 and #6279 @hagmic in #6328 -
Apollo Link core and HTTP related functionality has been merged into
@apollo/client. Functionality that was previously available through theapollo-link,apollo-link-http-commonandapollo-link-httppackages is now directly available from@apollo/client(e.g.import { HttpLink } from '@apollo/client'). TheApolloClientconstructor has also been updated to accept newuri,headersandcredentialsoptions. Ifuriis specified, Apollo Client will take care of creating the necessaryHttpLinkbehind the scenes. @hwillson in #5412 -
The
gqltemplate tag should now be imported from the@apollo/clientpackage, rather than thegraphql-tagpackage. Although thegraphql-tagpackage still works for now, future versions of@apollo/clientmay change the implementation details ofgqlwithout a major version bump. @hwillson in #5451 -
@apollo/client/corecan be used to import the Apollo Client core, which includes everything the main@apollo/clientpackage does, except for all React related functionality.
@kamilkisiela in #5541 -
Several deprecated methods have been fully removed:
ApolloClient#initQueryManagerQueryManager#startQueryObservableQuery#currentResult
-
Apollo Client now supports setting a new
ApolloLink(or link chain) afternew ApolloClient()has been called, using theApolloClient#setLinkmethod.
@hwillson in #6193 -
The final time a mutation
updatefunction is called, it can no longer accidentally read optimistic data from other concurrent mutations, which ensures the use of optimistic updates has no lasting impact on the state of the cache after mutations have finished. @benjamn in #6551 -
Apollo links that were previously maintained in https://github.com/apollographql/apollo-link have been merged into the Apollo Client project. They should be accessed using the new entry points listed in the migration guide.
@hwillson in #
InMemoryCache⚠️ Note:
InMemoryCachehas been significantly redesigned and rewritten in Apollo Client 3.0. Please consult the migration guide and read the new documentation to understand everything that has been improved.-
The
InMemoryCacheconstructor should now be imported directly from@apollo/client, rather than from a separate package. Theapollo-cache-inmemorypackage is no longer supported.The
@apollo/client/cacheentry point can be used to importInMemoryCachewithout importing other parts of the Apollo Client codebase. @hwillson in #5577 -
[BREAKING]
FragmentMatcher,HeuristicFragmentMatcher, andIntrospectionFragmentMatcherhave all been removed. We now recommend usingInMemoryCache’spossibleTypesoption instead. For more information see the DefiningpossibleTypesmanually section of the docs. @benjamn in #5073 -
[BREAKING] As promised in the Apollo Client 2.6 blog post, all cache results are now frozen/immutable. @benjamn in #5153
-
[BREAKING] Eliminate "generated" cache IDs to avoid normalizing objects with no meaningful ID, significantly reducing cache memory usage. This might be a backwards-incompatible change if your code depends on the precise internal representation of normalized data in the cache. @benjamn in #5146
-
[BREAKING]
InMemoryCachewill no longer merge the fields of written objects unless the objects are known to have the same identity, and the values of fields with the same name will not be recursively merged unless a custommergefunction is defined by a field policy for that field, within a type policy associated with the__typenameof the parent object. @benjamn in #5603 -
[BREAKING]
InMemoryCachenow throws when data with missing or undefined query fields is written into the cache, rather than just warning in development. @benjamn in #6055 -
[BREAKING]
client|cache.writeDatahave been fully removed.writeDatausage is one of the easiest ways to turn faulty assumptions about how the cache represents data internally, into cache inconsistency and corruption.client|cache.writeQuery,client|cache.writeFragment, and/orcache.modifycan be used to update the cache.
@benjamn in #5923 -
InMemoryCachenow supports tracing garbage collection and eviction. Note that the signature of theevictmethod has been simplified in a potentially backwards-incompatible way. @benjamn in #5310 -
[beta-BREAKING] Please note that the
cache.evictmethod now requiresCache.EvictOptions, though it previously supported positional arguments as well. @danReynolds in #6141 @benjamn in #6364 -
Removing an entity object using the
cache.evictmethod does not automatically remove dangling references to that entity elsewhere in the cache, but dangling references will be automatically filtered from lists whenever those lists are read from the cache. You can define a custom fieldreadfunction to customize this behavior. See #6412, #6425, and #6454 for further explanation. -
Cache methods that would normally trigger a broadcast, like
cache.evict,cache.writeQuery, andcache.writeFragment, can now be called with a named options object, which supports abroadcast: booleanproperty that can be used to silence the broadcast, for situations where you want to update the cache multiple times without triggering a broadcast each time. @benjamn in #6288 -
InMemoryCachenowconsole.warns in development whenever non-normalized data is dangerously overwritten, with helpful links to documentation about normalization and custommergefunctions. @benjamn in #6372 -
The result caching system (introduced in #3394) now tracks dependencies at the field level, rather than at the level of whole entity objects, allowing the cache to return identical (
===) results much more often than before. @benjamn in #5617 -
InMemoryCachenow has a method calledmodifywhich can be used to update the value of a specific field within a specific entity object:cache.modify({ id: cache.identify(post), fields: { comments(comments: Reference[], { readField }) { return comments.filter(comment => idToRemove !== readField("id", comment)); }, }, });This API gracefully handles cases where multiple field values are associated with a single field name, and also removes the need for updating the cache by reading a query or fragment, modifying the result, and writing the modified result back into the cache. Behind the scenes, the
cache.evictmethod is now implemented in terms ofcache.modify. @benjamn in #5909 and #6178 -
InMemoryCacheprovides a new API for storing client state that can be updated from anywhere:import { makeVar } from "@apollo/client" const v = makeVar(123) console.log(v()) // 123 console.log(v(v() + 1)) // 124 console.log(v()) // 124 v("asdf") // TS type errorThese variables are reactive in the sense that updating their values invalidates any previously cached query results that depended on the old values. @benjamn in #5799, #5976, and #6512
-
Various cache read and write performance optimizations, cutting read and write times by more than 50% in larger benchmarks. @benjamn in #5948
-
The
cache.readQueryandcache.writeQuerymethods now accept anoptions.idstring, which eliminates most use cases forcache.readFragmentandcache.writeFragment, and skips the implicit conversion of fragment documents to query documents performed bycache.{read,write}Fragment. @benjamn in #5930 -
Support
cache.identify(entity)for easily computing entity ID strings. @benjamn in #5642 -
Support eviction of specific entity fields using
cache.evict(id, fieldName). @benjamn in #5643 -
Make
InMemoryCache#evictremove data from allEntityStorelayers. @benjamn in #5773 -
Stop paying attention to
previousResultinInMemoryCache. @benjamn in #5644 -
Improve optimistic update performance by limiting cache key diversity. @benjamn in #5648
-
Custom field
readfunctions can read from neighboring fields using thereadField(fieldName)helper, and may also read fields from other entities by callingreadField(fieldName, objectOrReference). @benjamn in #5651 -
Expose cache
modifyandidentifyto the mutateupdatefunction.
@hwillson in #5956 -
Add a default
gcimplementation toApolloCache.
@justinwaite in #5974
React
-
[BREAKING] The
QueryOptions,MutationOptions, andSubscriptionOptionsReact Apollo interfaces have been renamed toQueryDataOptions,MutationDataOptions, andSubscriptionDataOptions(to avoid conflicting with similarly named and exported Apollo Client interfaces). -
[BREAKING] Results with
loading: truewill no longer redeliver previous data, though they may provide partial data from the cache, when available. @benjamn in #6566 -
[BREAKING?] Remove
fixPolyfills.ts, except when bundling for React Native. If you have trouble withMaporSetoperations due to frozen key objects in React Native, either update React Native to version 0.59.0 (or 0.61.x, if possible) or investigate whyfixPolyfills.native.jsis not included in your bundle. @benjamn in #5962 -
The contents of the
@apollo/react-hookspackage have been merged into@apollo/client, enabling the following all-in-oneimport:import { ApolloClient, ApolloProvider, useQuery } from '@apollo/client'; -
React SSR features (previously accessed via
@apollo/react-ssr) can now be accessed from the separate Apollo Client entry point of@apollo/client/react/ssr. These features are not included in the default@apollo/clientbundle.
@hwillson in #6499
General
-
[BREAKING] Removed
graphql-anywheresince it's no longer used by Apollo Client.
@hwillson in #5159 -
[BREAKING] Removed
apollo-boostsince Apollo Client 3.0 provides a boost like getting started experience out of the box.
@hwillson in #5217 -
[BREAKING] We are no longer exporting certain (intended to be) internal utilities. If you are depending on some of the lesser known exports from
apollo-cache,apollo-cache-inmemory, orapollo-utilities, they may no longer be available from@apollo/client. @hwillson in #5437 and #5514Utilities that were previously externally available through the
apollo-utilitiespackage are now only available by importing from@apollo/client/utilities. @hwillson in #5683 -
Make sure all
graphql-tagpublic exports are re-exported.
@hwillson in #5861 -
Fully removed
prettier. The Apollo Client team has decided to no longer automatically enforce code formatting across the codebase. In most cases existing code styles should be followed as much as possible, but this is not a hard and fast rule.
@hwillson in #5227 -
Make sure
ApolloContextplays nicely with IE11 when storing the shared context.
@ms in #5840 -
Migrated React Apollo HOC and Components functionality into Apollo Client, making it accessible from
@apollo/client/react/componentsand@apollo/client/react/hocentry points.
@hwillson in #6558 -
Support passing a
contextobject through the link execution chain when using subscriptions.
@sgtpepper43 in #4925 -
MockSubscriptionLinknow supports multiple subscriptions.
@dfrankland in #6081
Bug Fixes
-
useMutationadjustments to help avoid an infinite loop / too many renders issue, caused by unintentionally modifying theuseStatebased mutation result directly.
@hwillson in #5770 -
Missing
__typenamefields no longer cause theInMemoryCache#diffresult to be markedcomplete: false, if those fields were added byInMemoryCache#transformDocument(which callsaddTypenameToDocument). @benjamn in #5787 -
Fixed an issue that allowed
@client @exportbased queries to lead to extra unnecessary network requests being fired.
@hwillson in #5946 -
Refined
useLazyQuerytypes to help prevent runtime errors.
@benmosher in #5935 -
Make sure
@client @exportvariables used in watched queries are updated each time the query receives new data that changes the value of the@exportvariable.
@hwillson in #5986 -
Ensure
useMutationpasses a definederrorPolicyoption into its underlyingApolloClient.mutate()call.
@jamesreggio in #5863 -
useQuery: Prevent new data re-render attempts during an existing render. This helps avoid React 16.13.0's "Cannot update a component from inside the function body of a different component" warning (https://github.com/facebook/react/pull/17099). @hwillson in #6107 -
Expand
ApolloErrortypings to includeServerErrorandServerParseError.
@dmarkow in #6319 -
Fast responses received over the link chain will no longer conflict with
skipsettings.
@hwillson in #6587
-
- 3.0.0-rc.1313 Jul 2020pre-release
Nothing published for this version
- 3.0.0-rc.129 Jul 2020pre-release
Nothing published for this version
- 3.0.0-rc.119 Jul 2020pre-release
Nothing published for this version
- 3.0.0-rc.1030 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.925 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.823 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.722 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.617 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.516 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.411 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.310 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.25 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.14 Jun 2020pre-release
Nothing published for this version
- 3.0.0-rc.02 Jun 2020pre-release
Release notes
Open source →Now that the release candidate phase of testing has begun, we will do our very best to avoid introducing any new features or breaking API changes, unless those changes are absolutely necessary to fix bugs.
We are very much aware of a number of outstanding bugs, and we fully intend to fix all known bugs before the final AC3 release, in addition to continuing to write and edit the documentation for new AC3 features: https://github.com/apollographql/apollo-client/milestone/14
If you have been waiting for a signal that the AC3 API is stable/frozen, this is it. However, if you are not interested in helping to identify and fix (or at least work around) the remaining issues, then you should wait for the final release before updating.
Changes: https://github.com/apollographql/apollo-client/blob/v3.0.0-rc.0/CHANGELOG.md
- 3.0.0-james.33.05 Feb 2020pre-releasewithdrawn: DO NOT USE THIS VERSION - Use the latest @apollo/client@beta version instead.
Nothing published for this version
- 3.0.0-james.32.14 Feb 2020pre-releasewithdrawn: DO NOT USE THIS VERSION - Use the latest @apollo/client@beta version instead.
Nothing published for this version
- 3.0.0-beta.32-james4 Feb 2020pre-releasewithdrawn: DO NOT USE THIS VERSION - Use the latest @apollo/client@beta version instead.
Nothing published for this version
- 3.0.0-beta.541 Jun 2020pre-release
Nothing published for this version
- 3.0.0-beta.5330 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.5229 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.5128 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.5021 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.4918 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.4813 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.4713 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.467 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.455 May 2020pre-release
Nothing published for this version
- 3.0.0-beta.4421 Apr 2020pre-release
Nothing published for this version
- 3.0.0-beta.437 Apr 2020pre-release
Nothing published for this version
- 3.0.0-beta.423 Apr 2020pre-release
Nothing published for this version
- 3.0.0-beta.4113 Mar 2020pre-release
Nothing published for this version
- 3.0.0-beta.4012 Mar 2020pre-release
Nothing published for this version
- 3.0.0-beta.397 Mar 2020pre-release
Nothing published for this version
- 3.0.0-beta.3826 Feb 2020pre-release
Nothing published for this version
- 3.0.0-beta.3721 Feb 2020pre-release
Nothing published for this version
- 3.0.0-beta.3618 Feb 2020pre-release
Nothing published for this version
- 3.0.0-beta.3516 Feb 2020pre-release
Nothing published for this version
- 3.0.0-beta.3410 Feb 2020pre-release
Nothing published for this version
- 3.0.0-beta.335 Feb 2020pre-release
Nothing published for this version
- 3.0.0-beta.323 Feb 2020pre-release
Nothing published for this version
- 3.0.0-beta.3130 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.3029 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2928 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2828 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2727 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2624 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2523 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2417 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2314 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2213 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.2111 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.209 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.193 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.182 Jan 2020pre-release
Nothing published for this version
- 3.0.0-beta.172 Jan 2020pre-release
Nothing published for this version