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.7.102 Mar 2023
Release notes3 sources agree
Open source →Patch Changes
-
#9438
52a9c8ea1Thanks @dciesielkiewicz! - Ensure theclientoption passed touseMutation's execute function is used when provided. Previously this option was ignored. -
#9124
975b923c0Thanks @andrebrantom! - MakeApolloClient.writeQueryandApolloClient.writeFragmentbehave more likecache.writeQueryandcache.writeFragmentby returning the reference returned by the cache.
-
- 3.7.917 Feb 2023
Release notes3 sources agree
Open source →Patch Changes
-
#10560
a561ecf43Thanks @benjamn! - Keep__typenamefragment when it does not contain@clientdirective and strip out inline fragments which use a@clientdirective. Thanks @Gazler and @mtsmfm! -
#10560
251a12806Thanks @benjamn! - RefactorremoveDirectivesFromDocumentto fix AST ordering sensitivities and avoid 1/3 AST traversals, potentially improving performance for large queries
-
- 3.7.815 Feb 2023
Release notes3 sources agree
Open source →Patch Changes
-
#7555
45562d6faThanks @TheCeloReis! - AddsTVariablesgeneric toGraphQLRequestandMockedResponseinterfaces. -
#10526
1d13de4f1Thanks @benjamn! - Tolerate undefinedconcast.sourcesifcompletecalled earlier thanconcast.start -
#10497
8a883d8a1Thanks @nevir! - UpdateSingleExecutionResultandIncrementalPayload'sdatatypes such that they no longer includeundefined, which was not a valid runtime value, to fix errors when TypeScript'sexactOptionalPropertyTypesis enabled.
-
- 3.7.73 Feb 2023
Release notes3 sources agree
Open source →Patch Changes
-
#10502
315faf9caThanks @jerelmiller! - Log a warning to the console when a mock passed toMockedProviderorMockLinkcannot be matched to a query during a test. This makes it easier to debug user errors in the mock setup, such as typos, especially if the query under test is using anerrorPolicyset toignore, which makes it difficult to know that a match did not occur. -
#10499
9e54f5dfaThanks @phryneas! - Allow the execution function returned byuseLazyQueryto change the query. -
#10362
14a56b105Thanks @mccraveiro! - Fix error when server returns an error and we are also querying for a local field
-
- 3.7.631 Jan 2023
Release notes3 sources agree
Open source →Patch Changes
- #10470
47435e879Thanks @alessbell! - Bumps TypeScript to4.9.4(previously4.7.4) and updates types to account for changes in TypeScript 4.8 by propagating contstraints on generic types. Technically this makes some types stricter as attempting to passnull|undefinedinto certain functions is now disallowed by TypeScript, but these were never expected runtime values in the first place. This should only affect you if you are wrapping functions provided by Apollo Client with your own abstractions that pass in their generics as type arguments, in which case you might get an error likeerror TS2344: Type 'YourGenericType' does not satisfy the constraint 'OperationVariables'. In that case, make sure thatYourGenericTypeis restricted to a type that only accepts objects viaextends, likeRecord<string, any>or@apollo/client'sOperationVariables:
import { QueryHookOptions, QueryResult, useQuery, + OperationVariables, } from '@apollo/client'; - export function useWrappedQuery<T, TVariables>( + export function useWrappedQuery<T, TVariables extends OperationVariables>( query: DocumentNode, queryOptions: QueryHookOptions<T, TVariables> ): QueryResult<T, TVariables> { const [execute, result] = useQuery<T, TVariables>(query); }-
#10408
55ffafc58Thanks @zlrlo! - fix: modify BatchHttpLink to have a separate timer for each different batch key -
#9573
4a4f48ddaThanks @vladar! - Improve performance of local resolvers by only executing selection sets that contain an@clientdirective. Previously, local resolvers were executed even when the field did not contain@client. While the result was properly discarded, the unncessary work could negatively affect query performance, sometimes signficantly.
- #10470
- 3.7.524 Jan 2023
Release notes3 sources agree
Open source →Patch Changes
-
#10458
b5ccef229Thanks @lennyburdette! - PassesgetServerSnapshottouseSyncExternalStoreso that it doesn't trigger aMissing getServerSnapshoterror when usinguseFragment_experimentalon the server. -
#10471
895ddcb54Thanks @alessbell! - More robust type definition forheadersproperty passed tocreateHttpLink -
#10321
bbaa3ef2dThanks @alessbell! - Refetch should not return partial data witherrorPolicy: noneandnotifyOnNetworkStatusChange: true. -
#10469
328c58f90Thanks @jerelmiller! - Add generic type defaults when usinguseFragmentto allow passingTDatadirectly to the function without needing to specifyTVars.
-
- 3.7.413 Jan 2023
Release notes3 sources agree
Open source →Patch Changes
-
#10427
28d909cffThanks @jerelmiller! - Ensure in-flight promises executed byuseLazyQueryare rejected whenuseLazyQueryunmounts. -
#10383
5c5ca9b01Thanks @jerelmiller! - Ensure theonErrorcallback is called when theerrorPolicyis set to "all" and partial data is returned. -
#10425
86e35a6d2Thanks @jerelmiller! - Prefer theonErrorandonCompletedcallback functions passed to the execute function returned fromuseMutationinstead of calling both callback handlers.
-
- 3.7.315 Dec 2022
Release notes3 sources agree
Open source →Patch Changes
-
#10334
7d923939dThanks @jerelmiller! - Better handle deferred queries that have cached or partial cached data for them -
#10368
46b58e976Thanks @alessbell! - Fix: unblocks support for defer in mutationsIf the
@deferdirective is present in the document passed tomutate, the Promise will resolve with the final merged data after the last multipart chunk has arrived in the response.
-
- 3.7.26 Dec 2022
Release notes
Open source →Improvements (from
CHANGELOG.md)-
Only show dev tools suggestion in the console when
connectToDevToolsistrue. @chris110408 in #10258 -
Pass
TCachegeneric toMutationHookOptionsfor better type support inuseMutation. @igrlk in #10223 -
Add
nameproperty toApolloErrorto ensure better type safety and help error reporting tools better identify the error. @aaronadamsCA in #9323 -
Export a
ModifierDetailstype for thedetailsparameter of aModifierfunction. @KeithGillette in #7133 -
Revert use of
cloneDeepto clone options when fetching queries. @MrDoomBringer in #10215
What's Changed (auto-generated by GitHub)
- Add connect to dev tools check by @chris110408 in https://github.com/apollographql/apollo-client/pull/10258
- Update the CHANGELOG by @jerelmiller in https://github.com/apollographql/apollo-client/pull/10260
- Revert cloneDeep-ing request headers by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10215
- chore(tests): warn on ts-jest diagnostics error outside of CI test runs by @alessbell in https://github.com/apollographql/apollo-client/pull/10268
- updates roadmap nov 2022 by @jpvajda in https://github.com/apollographql/apollo-client/pull/10269
- docs: displays the error correctly by @ctesniere in https://github.com/apollographql/apollo-client/pull/10275
- Update the CHANGELOG with changes from #10275 by @bignimbus in https://github.com/apollographql/apollo-client/pull/10276
- Fix 'broken' links by @StephenBarlow in https://github.com/apollographql/apollo-client/pull/10288
- Additional documentation for managing local state by @bignimbus in https://github.com/apollographql/apollo-client/pull/10282
- chore(docs): remove graphql-anywhere from apollo-link-rest doc by @alessbell in https://github.com/apollographql/apollo-client/pull/10232
- doc(static-typing): rewrite with GraphQL Code Generator setup by @charlypoly in https://github.com/apollographql/apollo-client/pull/10173
- Further update the TypeGen article for style by @rkoron007 in https://github.com/apollographql/apollo-client/pull/10294
- Pass TCache generic to MutationHookOptions by @igrlk in https://github.com/apollographql/apollo-client/pull/10223
- Add name property to ApolloError by @aaronadamsCA in https://github.com/apollographql/apollo-client/pull/9323
- Add array examples to reactive variable documentation by @larrymyers in https://github.com/apollographql/apollo-client/pull/10235
- Update CHANGELOG with changes from #10235 by @bignimbus in https://github.com/apollographql/apollo-client/pull/10302
- docs: Update subscribeToMore example to use React hooks by @trevorblades in https://github.com/apollographql/apollo-client/pull/10309
- export separate
ModifierUtilitytype by @KeithGillette in https://github.com/apollographql/apollo-client/pull/7133 - Changelog and docs for preserveHeaderCase by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10111
New Contributors
- @chris110408 made their first contribution in https://github.com/apollographql/apollo-client/pull/10258
- @ctesniere made their first contribution in https://github.com/apollographql/apollo-client/pull/10275
- @charlypoly made their first contribution in https://github.com/apollographql/apollo-client/pull/10173
- @igrlk made their first contribution in https://github.com/apollographql/apollo-client/pull/10223
- @aaronadamsCA made their first contribution in https://github.com/apollographql/apollo-client/pull/9323
- @larrymyers made their first contribution in https://github.com/apollographql/apollo-client/pull/10235
- @KeithGillette made their first contribution in https://github.com/apollographql/apollo-client/pull/7133
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.7.1...v3.7.2
Additional notes2 sources agree
Open source →Patch Changes
-
Only show dev tools suggestion in the console when
connectToDevToolsistrue. <br/> @chris110408 in #10258 -
Pass
TCachegeneric toMutationHookOptionsfor better type support inuseMutation. <br /> @igrlk in #10223 -
Add
nameproperty toApolloErrorto ensure better type safety and help error reporting tools better identify the error. <br /> @aaronadamsCA in #9323 -
Export a
ModifierDetailstype for thedetailsparameter of aModifierfunction. <br /> @KeithGillette in #7133 -
Revert use of
cloneDeepto clone options when fetching queries. <br /> @MrDoomBringer in #10215
-
- 3.7.120 Oct 2022
Release notes
Open source →Bug fixes (from
CHANGELOG.md)-
Fix issue where
loadingremainstrueafterobserver.refetchis called repeatedly with different variables when the same data are returned. @alessbell in #10143 -
Fix race condition where
useFragment_experimentalcould receive cache updates before initially callingcache.watchinuseEffect. @benjamn in #10212
What's Changed (auto-generated by GitHub)
- changes install message by @jpvajda in https://github.com/apollographql/apollo-client/pull/10149
- oct 2022 roadmap update by @jpvajda in https://github.com/apollographql/apollo-client/pull/10161
- Small updates for AS4 by @rkoron007 in https://github.com/apollographql/apollo-client/pull/10175
- Various edits to caching docs by @StephenBarlow in https://github.com/apollographql/apollo-client/pull/9984
- Use nav nesting and tweak defer article slightly by @StephenBarlow in https://github.com/apollographql/apollo-client/pull/10187
- Call
iterateObserversSafelyif vars change between calls toobserver.nextby @alessbell in https://github.com/apollographql/apollo-client/pull/10143 - Update docs algolia filters by @trevorblades in https://github.com/apollographql/apollo-client/pull/10200
- Fix typo in
NetworkErrorby @OliverWales in https://github.com/apollographql/apollo-client/pull/10204 - Update apollo-link-rest.md - Add graphql-anywhere to install list by @pfcodes in https://github.com/apollographql/apollo-client/pull/10138
- Use custom
config/bundlesize.tsscript to avoidiltorbdependency, unbreakingnpm installwhen using Node.js v19 by @benjamn in https://github.com/apollographql/apollo-client/pull/10206 - Experiment with not caching the
~/.npmdirectory during Filesize/Tests CircleCI jobs by @benjamn in https://github.com/apollographql/apollo-client/pull/10209 - docs: add TypedDocumentNode example by @henryqdineen in https://github.com/apollographql/apollo-client/pull/10031
- Update Local Resolvers docs by @bignimbus in https://github.com/apollographql/apollo-client/pull/10211
- Remove (deprecated) from Local resolvers doc title by @bignimbus in https://github.com/apollographql/apollo-client/pull/10213
- Remaining Local Resolvers wordsmithing by @bignimbus in https://github.com/apollographql/apollo-client/pull/10214
- Call
forceUpdateimmediately ifdiffchanges between firstuseFragmentcall and firstcache.watchcall by @benjamn in https://github.com/apollographql/apollo-client/pull/10212
New Contributors (auto-generated by GitHub)
- @OliverWales made their first contribution in https://github.com/apollographql/apollo-client/pull/10204
- @pfcodes made their first contribution in https://github.com/apollographql/apollo-client/pull/10138
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.7.0...v3.7.1
Additional notes2 sources agree
Open source →Patch Changes
-
Fix issue where
loadingremainstrueafterobserver.refetchis called repeatedly with different variables when the same data are returned. <br/> @alessbell in #10143 -
Fix race condition where
useFragment_experimentalcould receive cache updates before initially callingcache.watchinuseEffect. <br/> @benjamn in #10212
-
- 3.7.030 Sept 2022
Release notes
Open source →New Features (from
CHANGELOG.md)-
Implement preview support for the
@deferdirective. @alessbell and @benjamn in #10018 -
Implement
useFragment_experimentalhook, which represents a lightweight live binding into theApolloCache, and never triggers network requests of its own. @benjamn in #8782 -
Allow registering named fragments with
InMemoryCacheto support using...NamedFragmentin queries without redeclaringNamedFragmentrepeatedly in every query that uses it. @benjamn in #9764 -
Support
onErrorcallback foruseSubscriptionhook. @jeroenvisser101 in #9495
Improvements (from
CHANGELOG.md)-
Delay calling
onCompletedandonErrorcallbacks passed touseQueryusingPromise.resolve().then(() => ...)to fix issue #9794. @dylanwulf in #9823 -
Replace
concast.cleanupmethod with simplerconcast.beforeNextAPI, which promises to call the given callback function just before the next result/error is delivered. In addition,concast.removeObserverno longer takes aquietly?: booleanparameter, since that parameter was partly responsible for cleanup callbacks sometimes not getting called. @benjamn in #9718 -
Allow preserving header name capitalization when creating an
HttpLinkwithcreateHttpLink({ uri, preserveHeaderCase: true }). Otherwise, header names are converted to lowercase to prevent case-sensitivity bugs. @MrDoomBringer in #9891 -
Make queries with a
pollIntervalrespect theno-cachefetch policy, instead of writing polled results into the cache. @MrDoomBringer in #10020 -
Deprecate the
onSubscriptionDatacallback in favor of a newonDatacallback for theuseSubscriptionhook. Deprecate theonSubscriptionCompletecallback in favor of a newonCompletecallback for theuseSubscriptionhook. @jerelmiller in #10134
Potentially disruptive (from
CHANGELOG.md)- The optional
subscribeAndCounttesting utility exported from@apollo/client/testing/corenow takes a single genericTResulttype parameter, instead ofTData. This type will typically be inferred from theobservableargument type, but if you have any explicit calls tosubscribeAndCount<TData>(...)in your own codebase, you may need to adjust those calls accordingly. @benjamn in #9718
What's Changed (auto-generated by GitHub)
- Replace
concast.cleanupmethod with simplerconcast.beforeNextAPI by @benjamn in https://github.com/apollographql/apollo-client/pull/9718 - Implement minimal
useFragmenthook by @benjamn in https://github.com/apollographql/apollo-client/pull/8782 - Fix
BatchHttpLinkregression that silently discarded some pending queries by @benjamn in https://github.com/apollographql/apollo-client/pull/9793 - Delay execution of callback functions to fix React errors by @dylanwulf in https://github.com/apollographql/apollo-client/pull/9801
- Return most recent result diff from useFragment, update test by @alessbell in https://github.com/apollographql/apollo-client/pull/10030
- Supports "no-cache" fetchPolicy with pollInterval by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10020
- (Release 3.7) Rename useFragment -> useFragment_experimental by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10075
- Adds @defer support by @alessbell in https://github.com/apollographql/apollo-client/pull/10018
- Improvements to the
hasDirectivesutility function by @benjamn in https://github.com/apollographql/apollo-client/pull/10082 - chore: omit previousResult, lastCompleteResult from options/result by @alessbell in https://github.com/apollographql/apollo-client/pull/10100
- Support header name capitalization by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/9891
- Add onError option to useSubscription hook by @jeroenvisser101 in https://github.com/apollographql/apollo-client/pull/9495
- Avoid letting
defaultDataIdFromObjectnormalize objects with nullish ids by @benjamn in https://github.com/apollographql/apollo-client/pull/9862 - Allow registering named fragments with
InMemoryCacheto support using...FragmentNamein queries without redeclaringFragmentNamein every query by @benjamn in https://github.com/apollographql/apollo-client/pull/9764 - Fix various flaky tests before publishing
@apollo/[email protected]by @benjamn in https://github.com/apollographql/apollo-client/pull/10118 - Update handler names for useSubscription hook by @jerelmiller in https://github.com/apollographql/apollo-client/pull/10134
- Add changes from #10134 to CHANGELOG.md by @jerelmiller in https://github.com/apollographql/apollo-client/pull/10148
- Release 3.7.0 by @benjamn in https://github.com/apollographql/apollo-client/pull/9633
New Contributors 🎉 🙌 🥳
- @jeroenvisser101 made their first contribution in https://github.com/apollographql/apollo-client/pull/9495
- @jerelmiller made their first contribution in https://github.com/apollographql/apollo-client/pull/10134
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.10...v3.7.0
Additional notes2 sources agree
Open source →Minor Changes
-
Implement preview support for the
@deferdirective. <br/> @alessbell and @benjamn in #10018 -
Implement
useFragment_experimentalhook, which represents a lightweight live binding into theApolloCache, and never triggers network requests of its own. <br/> @benjamn in #8782 -
Allow registering named fragments with
InMemoryCacheto support using...NamedFragmentin queries without redeclaringNamedFragmentrepeatedly in every query that uses it. <br/> @benjamn in #9764 -
Support
onErrorcallback foruseSubscriptionhook. <br/> @jeroenvisser101 in #9495 -
Implement
preserveHeaderCaseoption forhttpcontext object, enabling preserved header capitalization for non-http-spec-compliant servers. <br/> @mrdoombringer in #9891
Patch Changes
-
Delay calling
onCompletedandonErrorcallbacks passed touseQueryusingPromise.resolve().then(() => ...)to fix issue #9794. <br/> @dylanwulf in #9823 -
Replace
concast.cleanupmethod with simplerconcast.beforeNextAPI, which promises to call the given callback function just before the next result/error is delivered. In addition,concast.removeObserverno longer takes aquietly?: booleanparameter, since that parameter was partly responsible for cleanup callbacks sometimes not getting called. <br/> @benjamn in #9718 -
Allow preserving header name capitalization when creating an
HttpLinkwithcreateHttpLink({ uri, preserveHeaderCase: true }). Otherwise, header names are converted to lowercase to prevent case-sensitivity bugs. <br/> @MrDoomBringer in #9891 -
Make queries with a
pollIntervalrespect theno-cachefetch policy, instead of writing polled results into the cache. <br/> @MrDoomBringer in #10020 -
Deprecate the
onSubscriptionDatacallback in favor of a newonDatacallback for theuseSubscriptionhook. Deprecate theonSubscriptionCompletecallback in favor of a newonCompletecallback for theuseSubscriptionhook.<br/> @jerelmiller in #10134
Potentially disruptive
- The optional
subscribeAndCounttesting utility exported from@apollo/client/testing/corenow takes a single genericTResulttype parameter, instead ofTData. This type will typically be inferred from theobservableargument type, but if you have any explicit calls tosubscribeAndCount<TData>(...)in your own codebase, you may need to adjust those calls accordingly. <br/> @benjamn in #9718
-
- 3.7.0-rc.021 Sept 2022pre-release
Nothing published for this version
- 3.7.0-beta.821 Sept 2022pre-release
Nothing published for this version
- 3.7.0-beta.78 Sept 2022pre-release
Nothing published for this version
- 3.7.0-beta.627 Jun 2022pre-release
Nothing published for this version
- 3.7.0-beta.510 Jun 2022pre-release
Nothing published for this version
- 3.7.0-beta.410 Jun 2022pre-release
Nothing published for this version
- 3.7.0-beta.37 Jun 2022pre-release
Nothing published for this version
- 3.7.0-beta.27 Jun 2022pre-release
Nothing published for this version
- 3.7.0-beta.126 May 2022pre-release
Nothing published for this version
- 3.7.0-beta.025 May 2022pre-release
Nothing published for this version
- 3.7.0-alpha.619 May 2022pre-release
Nothing published for this version
- 3.7.0-alpha.516 May 2022pre-release
Nothing published for this version
- 3.7.0-alpha.413 May 2022pre-release
Nothing published for this version
- 3.7.0-alpha.39 May 2022pre-release
Nothing published for this version
- 3.7.0-alpha.23 May 2022pre-release
Nothing published for this version
- 3.7.0-alpha.13 May 2022pre-release
Nothing published for this version
- 3.7.0-alpha.027 Apr 2022pre-release
Nothing published for this version
- 3.6.1029 Sept 2022
Release notes
Open source →Improvements (from
CHANGELOG.md)- The client options (
variables,context, etc.) used formutationcalls are now available as the second argument to theonCompletedandonErrorcallback functions. @MrDoomBringer in #10052
What's Changed
- adds a prettier ignore file by @jpvajda in https://github.com/apollographql/apollo-client/pull/9809
- Fix documentation code snippets for SubscriptionClient by @jpikora in https://github.com/apollographql/apollo-client/pull/9820
- Add a new maintainer (Yours Truly) to README by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/9863
- Remove Ignoring errors sections in link and error handling docs. by @alessbell in https://github.com/apollographql/apollo-client/pull/9854
- Update the getting started guide to use the FlyBy API by @rkoron007 in https://github.com/apollographql/apollo-client/pull/9851
- Mockprovider docs updates by @jpvajda in https://github.com/apollographql/apollo-client/pull/9867
- Updates testing docs to use Testing Library by @alessbell in https://github.com/apollographql/apollo-client/pull/9888
- Clarify that id is optional on queries in cache.modify documentation by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/9894
- Add defensive isMounted checks before setting state via useMutation Hook by @alessbell in https://github.com/apollographql/apollo-client/pull/9883
- Add onQueryUpdate missing parameters by @capucho in https://github.com/apollographql/apollo-client/pull/9898
- Type policy inheritance by @jpvajda in https://github.com/apollographql/apollo-client/pull/9905
- Use reactive var hook by @jpvajda in https://github.com/apollographql/apollo-client/pull/9906
- Remove jest-fetch-mock in favor of fetch-mock, update tests by @alessbell in https://github.com/apollographql/apollo-client/pull/9928
- Minor edits to new useReactiveVar reference by @StephenBarlow in https://github.com/apollographql/apollo-client/pull/9932
- Add the new CodeSandbox link by @rkoron007 in https://github.com/apollographql/apollo-client/pull/9945
- Pin TypeDoc version in Netlify command by @trevorblades in https://github.com/apollographql/apollo-client/pull/9950
- Fix TypeDoc generated file paths by @trevorblades in https://github.com/apollographql/apollo-client/pull/9951
- Quick doc change to clarify subscriptions don't work in client schema by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/9944
- Run React 17 + 18 tests on CI by @alessbell in https://github.com/apollographql/apollo-client/pull/9942
- Roadmap update by @jpvajda in https://github.com/apollographql/apollo-client/pull/9966
- chore: update renovate config and add .npmrc by @alessbell in https://github.com/apollographql/apollo-client/pull/9967
- chore: update CONTRIBUTING.md by @alessbell in https://github.com/apollographql/apollo-client/pull/9953
- Field policy merge docs by @jpvajda in https://github.com/apollographql/apollo-client/pull/9969
- add link to solid.js github repo by @jpvajda in https://github.com/apollographql/apollo-client/pull/9981
- Replace crypto-hash with a custom hashing function in tests by @hwillson in https://github.com/apollographql/apollo-client/pull/9986
- adds broadcast false details by @jpvajda in https://github.com/apollographql/apollo-client/pull/9978
- Use function declaration for
WithApolloClientexample by @charpeni in https://github.com/apollographql/apollo-client/pull/9977 - docs: Update code block meta strings to make syntax highlighting work again by @trevorblades in https://github.com/apollographql/apollo-client/pull/9985
- Fix updateQuery docs having incorrect function signature by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10002
- Correct error handling example in docs by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/9996
- updates roadmap by @jpvajda in https://github.com/apollographql/apollo-client/pull/10013
- adds solid.js to integrations.md by @jpvajda in https://github.com/apollographql/apollo-client/pull/10014
- docs: fix React default import by @henryqdineen in https://github.com/apollographql/apollo-client/pull/10036
- docs: remove errant duplicated text by @henryqdineen in https://github.com/apollographql/apollo-client/pull/10046
- updates local resolver warning by @jpvajda in https://github.com/apollographql/apollo-client/pull/10062
- GitHub Workflows security hardening by @sashashura in https://github.com/apollographql/apollo-client/pull/10049
- Pass mutation options to handlers by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10052
- MissingFieldError once again extends Error by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10051
- Fix typos by @CompuWiser in https://github.com/apollographql/apollo-client/pull/10045
- Documentation update for ApolloQueryResult by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10055
- docs: Update "Using Apollo with TypeScript" with a description of fetchMore and subscribeToMore by @bignimbus in https://github.com/apollographql/apollo-client/pull/10066
- fix: make
react-doman optional peer dependency by @brillout in https://github.com/apollographql/apollo-client/pull/9933 - adds defer docs by @jpvajda in https://github.com/apollographql/apollo-client/pull/10079
- updates defer message by @jpvajda in https://github.com/apollographql/apollo-client/pull/10088
- Make it clear that @defer is available by installing beta by @hwillson in https://github.com/apollographql/apollo-client/pull/10096
- Better error message when failing to match mock variables by @zinkkrysty in https://github.com/apollographql/apollo-client/pull/9921
- Export
ModifierandModifiersby @olyop in https://github.com/apollographql/apollo-client/pull/8973 - chore(docs): add useFragment_experimental documentation by @alessbell in https://github.com/apollographql/apollo-client/pull/10099
- Bump up timeout time for batchLink, query and polling tests by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10097
- remove obsolete displayName query option by @henryqdineen in https://github.com/apollographql/apollo-client/pull/10044
- docs: fixup onResetStore docs, convert to hooks by @henryqdineen in https://github.com/apollographql/apollo-client/pull/10047
- changes beta to next by @jpvajda in https://github.com/apollographql/apollo-client/pull/10119
- local-state-management AC2 LocalState side note by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/10112
- Fix for ServerError obscured by ServerParseError by @dillontiner in https://github.com/apollographql/apollo-client/pull/9997
- Remove conditional require()s from SSR by @MrDoomBringer in https://github.com/apollographql/apollo-client/pull/9975
- chore(docs): use optional chaining rather than non-null assertion by @charpeni in https://github.com/apollographql/apollo-client/pull/10129
- chore(tests): use node v16.10.0 for jest tests due to memory leaks in 16.11+ by @alessbell in https://github.com/apollographql/apollo-client/pull/10140
- docs: Fix typo by @Javokhir12 in https://github.com/apollographql/apollo-client/pull/10128
New Contributors
- @jpikora made their first contribution in https://github.com/apollographql/apollo-client/pull/9820
- @capucho made their first contribution in https://github.com/apollographql/apollo-client/pull/9898
- @charpeni made their first contribution in https://github.com/apollographql/apollo-client/pull/9977
- @sashashura made their first contribution in https://github.com/apollographql/apollo-client/pull/10049
- @CompuWiser made their first contribution in https://github.com/apollographql/apollo-client/pull/10045
- @bignimbus made their first contribution in https://github.com/apollographql/apollo-client/pull/10066
- @brillout made their first contribution in https://github.com/apollographql/apollo-client/pull/9933
- @zinkkrysty made their first contribution in https://github.com/apollographql/apollo-client/pull/9921
- @olyop made their first contribution in https://github.com/apollographql/apollo-client/pull/8973
- @dillontiner made their first contribution in https://github.com/apollographql/apollo-client/pull/9997
- @Javokhir12 made their first contribution in https://github.com/apollographql/apollo-client/pull/10128
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.9...v.3.6.10
Additional notes2 sources agree
Open source →Improvements
- The client options (
variables,context, etc.) used formutationcalls are now available as the second argument to theonCompletedandonErrorcallback functions. <br/> @MrDoomBringer in #10052
- The client options (
- 3.6.921 Jun 2022
Release notes
Open source →Bug Fixes (from
CHANGELOG.md)- Leave
fetchPolicyunchanged whenskip: true(or in standby) andnextFetchPolicyis available, even ifvariableschange. @benjamn in #9823
What's Changed
- removes deprecation language by @jpvajda in https://github.com/apollographql/apollo-client/pull/9825
- Leave
fetchPolicyunchanged whenskip: true(or in standby) andnextFetchPolicyis available by @benjamn in https://github.com/apollographql/apollo-client/pull/9823
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.8...v3.6.9
- Leave
- 3.6.810 Jun 2022
Release notes
Open source →Bug Fixes (from
CHANGELOG.md)-
Fix incorrect
variablespassed inFieldFunctionOptionsfor nestedreadFieldcalls inreadandmergefunctions. @stardustxx in #9808 -
Improve repository build scripts to work better on Windows. @dylanwulf in #9805
-
Ensure
useQuery(query, { skip: true }).called === falserather than always returningcalledastrue. @KucharskiPiotr in #9798 -
Allow abandoned
reobserverequests to unsubscribe from their underlyingObservable. @javier-garcia-meteologica in #9791
What's Changed (auto-generated by GitHub)
- fix: fixes FieldFunctionOptions return incorrect variables by @stardustxx in https://github.com/apollographql/apollo-client/pull/9808
- Fix build config to work on Windows by @dylanwulf in https://github.com/apollographql/apollo-client/pull/9805
- Fix: useQuery returns called value based on skip option. by @KucharskiPiotr in https://github.com/apollographql/apollo-client/pull/9798
- fix: abort stale connection on reobserve (#9532) by @javier-garcia-meteologica in https://github.com/apollographql/apollo-client/pull/9791
New Contributors 🎉 🙌 🥳
- @stardustxx made their first PR in https://github.com/apollographql/apollo-client/pull/9808
- @dylanwulf made their first PR in https://github.com/apollographql/apollo-client/pull/9805
- @KucharskiPiotr made their first PR in https://github.com/apollographql/apollo-client/pull/9798
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.7...v3.6.8
Additional notes2 sources agree
Open source →Bug Fixes
-
Fix incorrect
variablespassed inFieldFunctionOptionsfor nestedreadFieldcalls inreadandmergefunctions. <br/> @stardustxx in #9808 -
Improve repository build scripts to work better on Windows. <br/> @dylanwulf in #9805
-
Ensure
useQuery(query, { skip: true }).called === falserather than always returningcalledastrue. <br/> @KucharskiPiotr in #9798 -
Allow abandoned
reobserverequests to unsubscribe from their underlyingObservable. <br/> @javier-garcia-meteologica in #9791
-
- 3.6.710 Jun 2022
Release notes
Open source →Bug Fixes (from
CHANGELOG.md)- Fix regression (introduced in v3.6.0) that caused
BatchHttpLinkto discard pending batched queries on early completion of the underlyingObservable. @benjamn in #9793
What's Changed (auto-generated by GitHub)
- fixes pr 9600 by @jpvajda in https://github.com/apollographql/apollo-client/pull/9776
- Update mutations.mdx by @Gregoirevda in https://github.com/apollographql/apollo-client/pull/9708
- updates roadmap for june 2022 by @jpvajda in https://github.com/apollographql/apollo-client/pull/9784
- fixes expansion panel by @jpvajda in https://github.com/apollographql/apollo-client/pull/9777
- Backport PR #9793 from
release-3.7branch tomainby @benjamn in https://github.com/apollographql/apollo-client/pull/9807
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.6...v3.6.7
- Fix regression (introduced in v3.6.0) that caused
- 3.6.626 May 2022
Release notes
Open source →What's Changed (auto-generated by GitHub)
- Allow
useLazyQuery(query, { defaultOptions })to benefit fromdefaultOptions.variablesby @benjamn in https://github.com/apollographql/apollo-client/pull/9762
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.5...v3.6.6
- Allow
- 3.6.523 May 2022
Release notes
Open source →Bug Fixes (from
CHANGELOG.md)-
Restore pre-v3.6
variablesreplacement behavior ofObservableQuery#reobservemethod, fixing a regression that prevented removal of variables. @benjamn in #9741 -
Preserve
previousDataeven when different query or client provided touseQuery, instead of resettingpreviousDatato undefined in those cases, matching behavior prior to v3.6.0. @benjamn in #9734 -
Fix bug where
onCompleted()andonError()are stale foruseMutation(). @charle692 in #9740 -
Limit scope of
DeepMergerobject reuse, and avoid usingObject.isFrozen, which can introduce differences between development and production if objects that were frozen usingObject.freezein development are left unfrozen in production. @benjamn in #9742 -
Properly merge
variablesfrom originaluseLazyQuery(query, { variables })withvariablespassed to execution function. @benjamn in #9758
What's Changed (auto-generated by GitHub)
- Preserve
previousDataeven when different client or query passed touseQueryby @benjamn in https://github.com/apollographql/apollo-client/pull/9734 - Restore pre-v3.6
variablesreplacement behavior ofObservableQuery#reobservemethod by @benjamn in https://github.com/apollographql/apollo-client/pull/9741 - Clarify modifying response data in link docs by @hatched-kade in https://github.com/apollographql/apollo-client/pull/9430
- adds documentation on file uploads by @jpvajda in https://github.com/apollographql/apollo-client/pull/9744
- Fix improper syntax with spread operator by @mongodben in https://github.com/apollographql/apollo-client/pull/9441
- Reduce confusion about the query component by @jpvajda in https://github.com/apollographql/apollo-client/pull/9747
- Fix bug where onCompleted and onError are stale for useMutation. onCompleted and onError could not be changed while a mutation is executing. by @charle692 in https://github.com/apollographql/apollo-client/pull/9740
- Restrict
DeepMergermutable object reuse to fix subtle production-only bug by @benjamn in https://github.com/apollographql/apollo-client/pull/9742 - Merge
variablesfrom originaluseLazyQuery(query, { variables })withvariablespassed to execution function by @benjamn in https://github.com/apollographql/apollo-client/pull/9758
New Contributors
- @hatched-kade made their first contribution in https://github.com/apollographql/apollo-client/pull/9430
- @mongodben made their first contribution in https://github.com/apollographql/apollo-client/pull/9441
- @charle692 made their first contribution in https://github.com/apollographql/apollo-client/pull/9740
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.4...v3.6.5
Additional notes2 sources agree
Open source →Bug Fixes
-
Restore pre-v3.6
variablesreplacement behavior ofObservableQuery#reobservemethod, fixing a regression that prevented removal of variables. <br/> @benjamn in #9741 -
Preserve
previousDataeven when different query or client provided touseQuery, instead of resettingpreviousDatato undefined in those cases, matching behavior prior to v3.6.0. <br/> @benjamn in #9734 -
Fix bug where
onCompleted()andonError()are stale foruseMutation(). <br/> @charle692 in #9740 -
Limit scope of
DeepMergerobject reuse, and avoid usingObject.isFrozen, which can introduce differences between development and production if objects that were frozen usingObject.freezein development are left unfrozen in production. <br/> @benjamn in #9742 -
Properly merge
variablesfrom originaluseLazyQuery(query, { variables })withvariablespassed to execution function. <br/> @benjamn in #9758
-
- 3.6.416 May 2022
Release notes
Open source →Bug Fixes (from
CHANGELOG.md)-
Guarantee
Concastcleanup withoutObservable cancelled prematurelyrejection, potentially solving long-standing issues involving that error. @benjamn in #9701 -
Ensure
useSubscriptionsubscriptions are properly restarted after unmounting/remounting by React 18 in<StrictMode>. @kazekyo in #9707
Improvements (from
CHANGELOG.md)-
Internalize
useSyncExternalStoreshim, for more control thanuse-sync-external-storeprovides, fixing some React Native issues. @benjamn in #9675 and #9709 -
Provide
@apollo/client/**/*.cjs.native.jsversions of every@apollo/client/**/*.cjsbundle (including dependenciests-invariantandzen-observable-ts) to help React Native's Metro bundler automatically resolve CommonJS entry point modules. These changes should render unnecessary the advice we gave in the v3.5.4 section below aboutmetro.config.js. @benjamn in #9716 -
Handle falsy
incomingdata more gracefully inoffetLimitPagination().mergefunction. @shobhitsharma in #9705
What's Changed (auto-generated by GitHub)
- Poll interval docs update by @jpvajda in https://github.com/apollographql/apollo-client/pull/9687
- [docs] Fix markdown bug in rest link by @ryanrhee in https://github.com/apollographql/apollo-client/pull/9698
- Internalize
useSyncExternalStoreshim, for more control thanuse-sync-external-storeprovides by @benjamn in https://github.com/apollographql/apollo-client/pull/9675 - Guarantee
Concastcleanup withoutObservable cancelled prematurelyrejection by @benjamn in https://github.com/apollographql/apollo-client/pull/9701 - docs: fix code snippet by @santiph in https://github.com/apollographql/apollo-client/pull/9703
- Update example headers with authentication by @theill in https://github.com/apollographql/apollo-client/pull/9621
- Fix a misplaced semicolon by @mlocher in https://github.com/apollographql/apollo-client/pull/9498
- Correct GraphQL variable name "text" to "type" by @FumioNonaka-ksj in https://github.com/apollographql/apollo-client/pull/9529
- Add apollo-multi-endpoint-link to community links by @jean9696 in https://github.com/apollographql/apollo-client/pull/9301
readQueryclarification by @avinoamsn in https://github.com/apollographql/apollo-client/pull/9195- Update authentication.mdx by @volokolamskspb in https://github.com/apollographql/apollo-client/pull/8630
- Add apollo-link-observable to community links by @dragozin in https://github.com/apollographql/apollo-client/pull/8234
- apollo-codegen is deprecated, but the tooling documentation still suggests it by @krainboltgreene in https://github.com/apollographql/apollo-client/pull/7517
- chore: corrected body params by @jpvajda in https://github.com/apollographql/apollo-client/pull/9711
useSyncExternalStorerefinements by @benjamn in https://github.com/apollographql/apollo-client/pull/9709- Help React Native import
@apollo/client/main.cjsand other CommonJS bundles by @benjamn in https://github.com/apollographql/apollo-client/pull/9716 - Revamping the "Why Apollo Client" article by @rkoron007 in https://github.com/apollographql/apollo-client/pull/9719
- Fix useSubscription bug in React v18 StrictMode (#9664) by @kazekyo in https://github.com/apollographql/apollo-client/pull/9707
New Contributors
- @ryanrhee made their first contribution in https://github.com/apollographql/apollo-client/pull/9698
- @santiph made their first contribution in https://github.com/apollographql/apollo-client/pull/9703
- @theill made their first contribution in https://github.com/apollographql/apollo-client/pull/9621
- @mlocher made their first contribution in https://github.com/apollographql/apollo-client/pull/9498
- @FumioNonaka-ksj made their first contribution in https://github.com/apollographql/apollo-client/pull/9529
- @jean9696 made their first contribution in https://github.com/apollographql/apollo-client/pull/9301
- @avinoamsn made their first contribution in https://github.com/apollographql/apollo-client/pull/9195
- @volokolamskspb made their first contribution in https://github.com/apollographql/apollo-client/pull/8630
- @dragozin made their first contribution in https://github.com/apollographql/apollo-client/pull/8234
- @krainboltgreene made their first contribution in https://github.com/apollographql/apollo-client/pull/7517
- @kazekyo made their first contribution in https://github.com/apollographql/apollo-client/pull/9707
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.3...v3.6.4
Additional notes2 sources agree
Open source →Bug Fixes
-
Guarantee
Concastcleanup withoutObservable cancelled prematurelyrejection, potentially solving long-standing issues involving that error. <br/> @benjamn in #9701 -
Ensure
useSubscriptionsubscriptions are properly restarted after unmounting/remounting by React 18 in<StrictMode>. <br/> @kazekyo in #9707
Improvements
-
Internalize
useSyncExternalStoreshim, for more control thanuse-sync-external-storeprovides, fixing some React Native issues. <br/> @benjamn in #9675 and #9709 -
Provide
@apollo/client/**/*.cjs.native.jsversions of every@apollo/client/**/*.cjsbundle (including dependenciests-invariantandzen-observable-ts) to help React Native's Metro bundler automatically resolve CommonJS entry point modules. These changes should render unnecessary the advice we gave in the v3.5.4 section below aboutmetro.config.js. <br/> @benjamn in #9716 -
Handle falsy
incomingdata more gracefully inoffetLimitPagination().mergefunction. <br/> @shobhitsharma in #9705
-
- 3.6.35 May 2022
Release notes
Open source →Bug Fixes (from
CHANGELOG.md)-
Simplify
useQuery(query, { defaultOptions })default options processing in order to fix bug whereskip: truequeries failed to execute upon switching toskip: false. @benjamn in #9665 -
Add tests of skipping/unskipping and
useLazyQuerywithdefaultOptions, and fix a bug causing duplicate requests. @benjamn in #9666 -
Update
ts-invariantto version 0.10.2 to fix source map warnings. @benjamn in #9672 -
Test that
useQueryqueries withskip: truedo not stall server-side rendering. @nathanmarks and @benjamn in #9677 -
Prevent
useLazyQueryfrom making duplicate requests when its execution function is first called, and stop rejecting thePromiseit returns whenresult.erroris defined. @benjamn in #9684 -
Fix issue with
useQueryreturningloading: truestate during server-side rendering withskip: true. @nathanmarks in #9679
What's Changed (auto-generated by GitHub)
- Drastically simplify
useQuerydefault options processing by @benjamn in https://github.com/apollographql/apollo-client/pull/9665 - Docs: fix typo in subscriptions.mdx by @pobch in https://github.com/apollographql/apollo-client/pull/9663
- Update
ts-invariantto version 0.10.2 to fix source map warnings by @benjamn in https://github.com/apollographql/apollo-client/pull/9672 - Update queries.mdx by @anilpai in https://github.com/apollographql/apollo-client/pull/5466
- Fix failing regression test for skipped SSR
useQuerystuck in standby by @benjamn in https://github.com/apollographql/apollo-client/pull/9677 - Add a comment about a new use of the content-type header by @glasser in https://github.com/apollographql/apollo-client/pull/9683
- Add missing assumeImmutableResults documentation by @henryqdineen in https://github.com/apollographql/apollo-client/pull/9680
- Prevent
useLazyQueryfrom making duplicate requests when execution function first called by @benjamn in https://github.com/apollographql/apollo-client/pull/9684 - Fix issue with
useQueryreturningloading: truestate during server-side rendering withskip: trueby @nathanmarks in https://github.com/apollographql/apollo-client/pull/9679 - Add description & example of how to handle multiple parameters in read() when declaring typePolicies. by @Moristotle in https://github.com/apollographql/apollo-client/pull/6755
- Add link to ts-transform-graphql-tag in the performance docs by @hcharley in https://github.com/apollographql/apollo-client/pull/5608
New Contributors
- @anilpai made their first contribution in https://github.com/apollographql/apollo-client/pull/5466
- @nathanmarks made their first contribution in https://github.com/apollographql/apollo-client/pull/9679
- @Moristotle made their first contribution in https://github.com/apollographql/apollo-client/pull/6755
- @hcharley made their first contribution in https://github.com/apollographql/apollo-client/pull/5608
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.2...v3.6.3
Additional notes2 sources agree
Open source →Bug Fixes
-
Simplify
useQuery(query, { defaultOptions })default options processing in order to fix bug whereskip: truequeries failed to execute upon switching toskip: false. <br/> @benjamn in #9665 -
Add tests of skipping/unskipping and
useLazyQuerywithdefaultOptions, and fix a bug causing duplicate requests. <br/> @benjamn in #9666 -
Update
ts-invariantto version 0.10.2 to fix source map warnings. <br/> @benjamn in #9672 -
Test that
useQueryqueries withskip: truedo not stall server-side rendering. <br/> @nathanmarks and @benjamn in #9677 -
Prevent
useLazyQueryfrom making duplicate requests when its execution function is first called, and stop rejecting thePromiseit returns whenresult.erroris defined. <br/> @benjamn in #9684 -
Fix issue with
useQueryreturningloading: truestate during server-side rendering withskip: true. <br/> @nathanmarks in #9679
-
- 3.6.23 May 2022
Release notes
Open source →What's Changed
- fix Missing getServerSnapshot on React 18 and Next 12 by @hungphongbk in https://github.com/apollographql/apollo-client/pull/9652
- Fix persistedQueries to pull graphqlErrors from networkErrors by @redaid113 in https://github.com/apollographql/apollo-client/pull/9410
- Update Apollo PersistedQueries in the Apollo BatchHTTP Link by @iamchathu in https://github.com/apollographql/apollo-client/pull/9637
- Fix code snippets for SubscriptionClient by @rkoron007 in https://github.com/apollographql/apollo-client/pull/9634
- Correct the wrong link in ROADMAP.md by @yukukotani in https://github.com/apollographql/apollo-client/pull/9650
- Update Copyright year in LICENSE by @garritfra in https://github.com/apollographql/apollo-client/pull/9630
New Contributors
- @iamchathu made their first contribution in https://github.com/apollographql/apollo-client/pull/9637
- @hungphongbk made their first contribution in https://github.com/apollographql/apollo-client/pull/9652
- @yukukotani made their first contribution in https://github.com/apollographql/apollo-client/pull/9650
- @redaid113 made their first contribution in https://github.com/apollographql/apollo-client/pull/9410
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.1...v3.6.2
Additional notes2 sources agree
Open source →Bug Fixes
- Pass
getServerSnapshotfunction touseSyncExternalStorein addition togetSnapshot, though the two functions behave identically. This change should fix/unbreak React 18 server rendering. <br/> @hungphongbk in #9652
Improvements
- Consider
networkError.result.errorsin addition toresult.errorsinPersistedQueryLink. <br/> @redaid113 and @benjamn in #9410
- 3.6.128 Apr 2022
Release notes
Open source →What's Changed
- Remove
WatchQueryOptions["fetchBlockingPromise"]option due to regressions by @benjamn in https://github.com/apollographql/apollo-client/pull/9636 - chore(deps): update dependency graphql-ws to v5.8.1 by @renovate in https://github.com/apollographql/apollo-client/pull/9592
- Update Full-stack tutorial links to point to Odyssey by @rkoron007 in https://github.com/apollographql/apollo-client/pull/9610
- changes the way the parser filters the array of definitions by @rasulomaroff in https://github.com/apollographql/apollo-client/pull/9622
- chore: updates roadmap by @jpvajda in https://github.com/apollographql/apollo-client/pull/9628
New Contributors
- @rasulomaroff made their first contribution in https://github.com/apollographql/apollo-client/pull/9622
- @jpvajda made their first contribution in https://github.com/apollographql/apollo-client/pull/9628
Full Changelog: https://github.com/apollographql/apollo-client/compare/v3.6.0...v3.6.1
- Remove
- 3.6.026 Apr 2022
Release notes
Open source →Note: for the most up-to-date version of this information, see
CHANGELOG.mdApollo Client 3.6.0 (2022-04-26)
Potentially disruptive changes
-
Calling
fetchMorefor queries using thecache-and-networkornetwork-onlyfetch policies will no longer trigger additional network requests when cache results are complete. Instead, those complete cache results will be delivered as if using thecache-firstfetch policy. @benjamn in #9504 -
Reimplement
useQueryanduseLazyQueryto use the proposeduseSyncExternalStoreAPI from React 18. @brainkim and @benjamn in #8785 and #9596 -
Fixed bug where the
useLazyQueryexecution function would always use therefetchmethod ofObservableQuery, instead of properly reapplying the currentfetchPolicyusing thereobservemethod. @benjamn in #9564Since this
reobservemethod is useful and used internally, we have now exposed it asuse[Lazy]Query(...).reobserve(which optionally takes aPartial<WatchQueryOptions>of new options), to supplement the existingrefetchmethod. Note thatreobservepermanently updates thevariablesand other options of theObservableQuery, unlikerefetch({ ...variables }), which does not save thosevariables. -
The internal use of
options.fetchBlockingPromisebyuseQueryanduseLazyQuerymay slightly delay the delivery of network results, compared to previous versions of Apollo Client. Since network results are already delivered asynchronously, these timing differences should not be disruptive in most cases. Nevertheless, please open an issue if the timing differences cause problems for your applications. @benjamn in #9599
React 18
In both its
peerDependenciesand its internal implementation, Apollo Client v3.6 should no longer prevent you from updating to React 18 in your applications.Internally, we have refactored
useQueryanduseLazyQueryto be implemented in terms of React's new (shimmable)useSyncExternalStorehook, demonstrating Apollo Client can serve as an external store with a referentially stable, synchronous API, as needed by React.As part of this refactoring, we also improved the behavior of
useQueryanduseLazyQuerywhen used in<React.StrictMode>, which double-renders components in development. While this double-rendering always results in callinguseQuerytwice, forcing Apollo Client to create and then discard an unnecessaryObservableQueryobject, we now have multiple defenses in place against executing any network queries for the unusedObservableQueryobjects.In upcoming v3.6.x and v3.7 (beta) releases, we will be completely overhauling our server-side rendering utilities (
getDataFromTreeet al.), and introducing suspenseful versions of our hooks, to take full advantage of the new patterns React 18+ enables for data management libraries like Apollo Client.Improvements
-
Allow
BatchLinkto cancel queued and in-flight operations. @PowerKiKi and @benjamn in #9248 -
Add
GraphQLWsLinkin@apollo/client/link/subscriptions. This link is similar to the existingWebSocketLinkin@apollo/client/link/ws, but uses the newergraphql-wspackage and protocol instead of the oldersubscriptions-transport-wsimplementation. This functionality was technically first released in@apollo/[email protected], but semantically belongs in the 3.6.0 minor version. @glasser in #9369 -
Allow passing
defaultOptionstouseQueryto avoid clobbering/resetting existing options whenuseQueryis called repeatedly. @benjamn in #9563, superseding #9223 -
Provide additional context to
nextFetchPolicyfunctions to assist withfetchPolicytransitions. More details can be found in thenextFetchPolicydocumentation. @benjamn in #9222 -
Remove nagging deprecation warning about passing an
options.updateQueryfunction tofetchMore. @benjamn in #9504 -
Let
addTypenameToDocumenttake anyASTNode(includingDocumentNode, as before). @benjamn in #9595 -
Set
useMutationinternalisMountedvariable totrueagain when component remounted. @devpeerapong in #9561
New Contributors
- @levrik made their first contribution in https://github.com/apollographql/apollo-client/pull/9299
- @julienfouilhe made their first contribution in https://github.com/apollographql/apollo-client/pull/9339
- @ctataryn made their first contribution in https://github.com/apollographql/apollo-client/pull/9434
- @hennessyevan made their first contribution in https://github.com/apollographql/apollo-client/pull/9470
- @rkoron007 made their first contribution in https://github.com/apollographql/apollo-client/pull/9500
- @jergason made their first contribution in https://github.com/apollographql/apollo-client/pull/9419
- @devpeerapong made their first contribution in https://github.com/apollographql/apollo-client/pull/9561
Additional notes2 sources agree
Open source →Potentially disruptive changes
-
Calling
fetchMorefor queries using thecache-and-networkornetwork-onlyfetch policies will no longer trigger additional network requests when cache results are complete. Instead, those complete cache results will be delivered as if using thecache-firstfetch policy. <br/> @benjamn in #9504 -
Reimplement
useQueryanduseLazyQueryto use the proposeduseSyncExternalStoreAPI from React 18. <br/> @brainkim and @benjamn in #8785 and #9596 -
Fixed bug where the
useLazyQueryexecution function would always use therefetchmethod ofObservableQuery, instead of properly reapplying the currentfetchPolicyusing thereobservemethod. <br/> @benjamn in #9564Since this
reobservemethod is useful and used internally, we have now exposed it asuse[Lazy]Query(...).reobserve(which optionally takes aPartial<WatchQueryOptions>of new options), to supplement the existingrefetchmethod. Note thatreobservepermanently updates thevariablesand other options of theObservableQuery, unlikerefetch({ ...variables }), which does not save thosevariables. -
The internal use of
options.fetchBlockingPromisebyuseQueryanduseLazyQuerymay slightly delay the delivery of network results, compared to previous versions of Apollo Client. Since network results are already delivered asynchronously, these timing differences should not be disruptive in most cases. Nevertheless, please open an issue if the timing differences are a problem for you (and you have no easy workaround). <br/> @benjamn in #9599
React 18
In both its
peerDependenciesand its internal implementation, Apollo Client v3.6 should no longer prevent you from updating to React 18 in your applications.Internally, we have refactored
useQueryanduseLazyQueryto be implemented in terms of React's new (shimmable)useSyncExternalStorehook, demonstrating Apollo Client can serve as an external store with a referentially stable, synchronous API, as needed by React.As part of this refactoring, we also improved the behavior of
useQueryanduseLazyQuerywhen used in<React.StrictMode>, which double-renders components in development. While this double-rendering always results in callinguseQuerytwice, forcing Apollo Client to create and then discard an unnecessaryObservableQueryobject, we now have multiple defenses in place against executing any network queries for the unusedObservableQueryobjects.In upcoming v3.6.x and v3.7 (beta) releases, we will be completely overhauling our server-side rendering utilities (
getDataFromTreeet al.), and introducing suspenseful versions of our hooks, to take full advantage of the new patterns React 18+ enables for data management libraries like Apollo Client.Improvements
-
Allow
BatchLinkto cancel queued and in-flight operations. <br/> @PowerKiKi and @benjamn in #9248 -
Add
GraphQLWsLinkin@apollo/client/link/subscriptions. This link is similar to the existingWebSocketLinkin@apollo/client/link/ws, but uses the newergraphql-wspackage and protocol instead of the oldersubscriptions-transport-wsimplementation. This functionality was technically first released in@apollo/[email protected], but semantically belongs in the 3.6.0 minor version. @glasser in #9369 -
Allow passing
defaultOptionstouseQueryto avoid clobbering/resetting existing options whenuseQueryis called repeatedly. <br/> @benjamn in #9563, superseding #9223 -
Provide additional context to
nextFetchPolicyfunctions to assist withfetchPolicytransitions. More details can be found in thenextFetchPolicydocumentation. <br/> @benjamn in #9222 -
Remove nagging deprecation warning about passing an
options.updateQueryfunction tofetchMore. <br/> @benjamn in #9504 -
Let
addTypenameToDocumenttake anyASTNode(includingDocumentNode, as before). <br/> @benjamn in #9595 -
Set
useMutationinternalisMountedvariable totrueagain when component remounted. <br/> @devpeerapong in #9561
-
- 3.6.0-rc.119 Apr 2022pre-release
Nothing published for this version
- 3.6.0-rc.018 Apr 2022pre-release
Nothing published for this version
- 3.6.0-beta.1314 Apr 2022pre-release
Nothing published for this version
- 3.6.0-beta.1211 Apr 2022pre-release
Nothing published for this version
- 3.6.0-beta.115 Apr 2022pre-release
Nothing published for this version
- 3.6.0-beta.1029 Mar 2022pre-release
Nothing published for this version
- 3.6.0-beta.910 Mar 2022pre-release
Nothing published for this version
- 3.6.0-beta.810 Mar 2022pre-release
Nothing published for this version
- 3.6.0-beta.710 Mar 2022pre-release
Nothing published for this version
- 3.6.0-beta.615 Feb 2022pre-release
Nothing published for this version
- 3.6.0-beta.54 Feb 2022pre-release
Nothing published for this version
- 3.6.0-beta.43 Feb 2022pre-release
Nothing published for this version
- 3.6.0-beta.323 Nov 2021pre-release
Nothing published for this version
- 3.6.0-beta.222 Nov 2021pre-release
Nothing published for this version
- 3.6.0-beta.116 Nov 2021pre-release
Nothing published for this version
- 3.6.0-beta.016 Nov 2021pre-release
Nothing published for this version
- 3.5.1024 Feb 2022
Release notes2 sources agree
Open source →Improvements
-
Add
GraphQLWsLinkin@apollo/client/link/subscriptions. This link is similar to the existingWebSocketLinkin@apollo/client/link/ws, but uses the newergraphql-wspackage and protocol instead of the oldersubscriptions-transport-wsimplementation. <br/> @glasser in #9369Note from @benjamn: since
GraphQLWsLinkis new functionality, we would normally wait for the next minor version (v3.6), but we were asked to expedite this release. These changes are strictly additive/opt-in/backwards-compatible, so shipping them in a patch release (3.5.10) seems safe, if unusual.
-
- 3.5.915 Feb 2022
Release notes2 sources agree
Open source →Improvements
-
Interpret
keyFields: [...]andkeyArgs: [...]configurations inInMemoryCachetype/field policies asReadonlyArrays, since they are never mutated internally. <br/> @julienfouilhe in #9339 -
Avoid declaring a global type for the
__DEV__constant, to avoid conflict with other such global declarations. <br/> @benjamn in #9386
Bug Fixes
-
Fix
useSubscriptionexecutingskipped subscription when input changes. <br/> @levrik in #9299 -
Fix partial data appearing in
useQuery().datawhennotifyOnNetworkStatusChange: true. <br/> @brainkim in #9367 -
Prevent
Promises returned byuseLazyQueryexecute functions from causing unhandledPromiserejection errors if uncaught. <br/> @brainkim in #9380
-
- 3.5.824 Jan 2022
Release notes2 sources agree
Open source →Bug Fixes
- Fix the type of the
calledproperty returned byuseQuery()anduseLazyQuery(). <br/> @sztadii in #9304
Bug Fixes (by @brainkim in #9328)
- Fix
refetch()not being called whenskipis true. - Fix the promise returned from the
useLazyQuery()execution function having stale variables. - Fix the promise returned from the
useLazyQuery()execution function not rejecting when a query errors.
- Fix the type of the
- 3.5.710 Jan 2022
Release notes2 sources agree
Open source →Bug Fixes
-
Fix regression that prevented calling
onErrororonCompletedin some cases when usinguseQuery. <br/> @mmahalwy in #9226 -
Make
useQueryrespectdefaultOptions.watchQuery.fetchPolicy. <br/> @yasharzolmajdi in #9210
-
- 3.5.67 Dec 2021
Release notes2 sources agree
Open source →Bug Fixes (by @brainkim in #9144)
- Restores old behavior where the callback passed to
useMutation()is constant. - Fix
useMutation()callbacks having stale closures. - Fix
useQuery()variables being out of date.
- Restores old behavior where the callback passed to