Releases: apollographql/apollo-client
v3.7.4
Patch Changes
-
#10427
28d909cff
Thanks @jerelmiller! - Ensure in-flight promises executed byuseLazyQuery
are rejected whenuseLazyQuery
unmounts. -
#10383
5c5ca9b01
Thanks @jerelmiller! - Ensure theonError
callback is called when theerrorPolicy
is set to "all" and partial data is returned. -
#10425
86e35a6d2
Thanks @jerelmiller! - Prefer theonError
andonCompleted
callback functions passed to the execute function returned fromuseMutation
instead of calling both callback handlers.
v3.8.0-alpha.3
3.8.0-alpha.3
Patch Changes
- #10399
652a1ae08
Thanks @alessbell! - Silence useLayoutEffect warning when useSuspenseQuery runs on server
v3.8.0-alpha.2
3.8.0-alpha.2
Minor Changes
- #10346
3bcfc42d3
Thanks @jerelmiller! - Add the ability to allow@client
fields to be sent to the link chain.
v3.8.0-alpha.1
3.8.0-alpha.15
Patch Changes
-
#10888
1562a2f5a
Thanks @alessbell! - Updates dependency versions inpackage.json
by bumping:@wry/context
to^0.7.3
@wry/equality
to^0.5.6
@wry/trie
to^0.4.3
optimism
to^0.17.4
to 1. fix sourcemap warnings and 2. a Codesandbox sandpack (in-browser) bundler transpilation bug with an upstream optimism workaround.
3.8.0-alpha.14
3.8.0-alpha.13
Patch Changes
-
#10766
ffb179e55
Thanks @jerelmiller! - More robust typings for thedata
property returned fromuseSuspenseQuery
when usingreturnPartialData: true
or anerrorPolicy
ofall
orignore
.TData
now defaults tounknown
instead ofany
. -
#10809
49d28f764
Thanks @jerelmiller! - Fixed the ability to userefetch
andfetchMore
with React'sstartTransition
. The hook will now behave correctly by allowing React to avoid showing the Suspense fallback when these functions are wrapped bystartTransition
. This change deprecates thesuspensePolicy
option in favor ofstartTransition
.
3.8.0-alpha.12
3.8.0-alpha.11
Minor Changes
- #10567
c2ce6496c
Thanks @benjamn! - AllowApolloCache
implementations to specify default value forassumeImmutableResults
client option, improving performance for applications currently usingInMemoryCache
without configuringnew ApolloClient({ assumeImmutableResults: true })
Patch Changes
-
#10672
932252b0c
Thanks @jerelmiller! - Fix the compatibility betweenuseSuspenseQuery
and React'suseDeferredValue
andstartTransition
APIs to allow React to show stale UI while the changes to the variable cause the component to suspend.Breaking change
nextFetchPolicy
support has been removed fromuseSuspenseQuery
. If you are using this option, remove it, otherwise it will be ignored.
3.8.0-alpha.10
3.8.0-alpha.1
Patch Changes
- #10324
95eb228be
Thanks @jerelmiller! - Add@defer
support touseSuspenseQuery
.
v3.7.3
Patch Changes
-
#10334
7d923939d
Thanks @jerelmiller! - Better handle deferred queries that have cached or partial cached data for them -
#10368
46b58e976
Thanks @alessbell! - Fix: unblocks support for defer in mutationsIf the
@defer
directive 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.
v3.8.0-alpha.0
3.8.0-alpha.0
Minor Changes
- #10323
64cb88a4b
Thanks @jerelmiller! - Add support for React suspense with a newuseSuspenseQuery
hook.
Patch Changes
- #10340
4f73c5ca1
Thanks @alessbell! - Avoid callinguseQuery
onCompleted
for cache writes
v3.7.2
Improvements (from CHANGELOG.md
)
-
Only show dev tools suggestion in the console when
connectToDevTools
istrue
.
@chris110408 in #10258 -
Pass
TCache
generic toMutationHookOptions
for better type support inuseMutation
.
@igrlk in #10223 -
Add
name
property toApolloError
to ensure better type safety and help error reporting tools better identify the error.
@aaronadamsCA in #9323 -
Export a
ModifierDetails
type for thedetails
parameter of aModifier
function.
@KeithGillette in #7133 -
Revert use of
cloneDeep
to clone options when fetching queries.
@MrDoomBringer in #10215
What's Changed (auto-generated by GitHub)
- Add connect to dev tools check by @chris110408 in #10258
- Update the CHANGELOG by @jerelmiller in #10260
- Revert cloneDeep-ing request headers by @MrDoomBringer in #10215
- chore(tests): warn on ts-jest diagnostics error outside of CI test runs by @alessbell in #10268
- updates roadmap nov 2022 by @jpvajda in #10269
- docs: displays the error correctly by @ctesniere in #10275
- Update the CHANGELOG with changes from #10275 by @bignimbus in #10276
- Fix 'broken' links by @StephenBarlow in #10288
- Additional documentation for managing local state by @bignimbus in #10282
- chore(docs): remove graphql-anywhere from apollo-link-rest doc by @alessbell in #10232
- doc(static-typing): rewrite with GraphQL Code Generator setup by @charlypoly in #10173
- Further update the TypeGen article for style by @rkoron007 in #10294
- Pass TCache generic to MutationHookOptions by @igrlk in #10223
- Add name property to ApolloError by @aaronadamsCA in #9323
- Add array examples to reactive variable documentation by @larrymyers in #10235
- Update CHANGELOG with changes from #10235 by @bignimbus in #10302
- docs: Update subscribeToMore example to use React hooks by @trevorblades in #10309
- export separate
ModifierUtility
type by @KeithGillette in #7133 - Changelog and docs for preserveHeaderCase by @MrDoomBringer in #10111
New Contributors
- @chris110408 made their first contribution in #10258
- @ctesniere made their first contribution in #10275
- @charlypoly made their first contribution in #10173
- @igrlk made their first contribution in #10223
- @aaronadamsCA made their first contribution in #9323
- @larrymyers made their first contribution in #10235
- @KeithGillette made their first contribution in #7133
Full Changelog: v3.7.1...v3.7.2
3.7.1
Bug fixes (from CHANGELOG.md
)
-
Fix issue where
loading
remainstrue
afterobserver.refetch
is called repeatedly with different variables when the same data are returned.
@alessbell in #10143 -
Fix race condition where
useFragment_experimental
could receive cache updates before initially callingcache.watch
inuseEffect
.
@benjamn in #10212
What's Changed (auto-generated by GitHub)
- changes install message by @jpvajda in #10149
- oct 2022 roadmap update by @jpvajda in #10161
- Small updates for AS4 by @rkoron007 in #10175
- Various edits to caching docs by @StephenBarlow in #9984
- Use nav nesting and tweak defer article slightly by @StephenBarlow in #10187
- Call
iterateObserversSafely
if vars change between calls toobserver.next
by @alessbell in #10143 - Update docs algolia filters by @trevorblades in #10200
- Fix typo in
NetworkError
by @OliverWales in #10204 - Update apollo-link-rest.md - Add graphql-anywhere to install list by @pfcodes in #10138
- Use custom
config/bundlesize.ts
script to avoidiltorb
dependency, unbreakingnpm install
when using Node.js v19 by @benjamn in #10206 - Experiment with not caching the
~/.npm
directory during Filesize/Tests CircleCI jobs by @benjamn in #10209 - docs: add TypedDocumentNode example by @henryqdineen in #10031
- Update Local Resolvers docs by @bignimbus in #10211
- Remove (deprecated) from Local resolvers doc title by @bignimbus in #10213
- Remaining Local Resolvers wordsmithing by @bignimbus in #10214
- Call
forceUpdate
immediately ifdiff
changes between firstuseFragment
call and firstcache.watch
call by @benjamn in #10212
New Contributors (auto-generated by GitHub)
- @OliverWales made their first contribution in #10204
- @pfcodes made their first contribution in #10138
Full Changelog: v3.7.0...v3.7.1
v3.7.0
New Features (from CHANGELOG.md
)
-
Implement preview support for the
@defer
directive.
@alessbell and @benjamn in #10018 -
Implement
useFragment_experimental
hook, which represents a lightweight live binding into theApolloCache
, and never triggers network requests of its own.
@benjamn in #8782 -
Allow registering named fragments with
InMemoryCache
to support using...NamedFragment
in queries without redeclaringNamedFragment
repeatedly in every query that uses it.
@benjamn in #9764 -
Support
onError
callback foruseSubscription
hook.
@jeroenvisser101 in #9495
Improvements (from CHANGELOG.md
)
-
Delay calling
onCompleted
andonError
callbacks passed touseQuery
usingPromise.resolve().then(() => ...)
to fix issue #9794.
@dylanwulf in #9823 -
Replace
concast.cleanup
method with simplerconcast.beforeNext
API, which promises to call the given callback function just before the next result/error is delivered. In addition,concast.removeObserver
no longer takes aquietly?: boolean
parameter, since that parameter was partly responsible for cleanup callbacks sometimes not getting called.
@benjamn in #9718 -
Allow preserving header name capitalization when creating an
HttpLink
withcreateHttpLink({ uri, preserveHeaderCase: true })
. Otherwise, header names are converted to lowercase to prevent case-sensitivity bugs.
@MrDoomBringer in #9891 -
Make queries with a
pollInterval
respect theno-cache
fetch policy, instead of writing polled results into the cache.
@MrDoomBringer in #10020 -
Deprecate the
onSubscriptionData
callback in favor of a newonData
callback for theuseSubscription
hook. Deprecate theonSubscriptionComplete
callback in favor of a newonComplete
callback for theuseSubscription
hook.
@jerelmiller in #10134
Potentially disruptive (from CHANGELOG.md
)
- The optional
subscribeAndCount
testing utility exported from@apollo/client/testing/core
now takes a single genericTResult
type parameter, instead ofTData
. This type will typically be inferred from theobservable
argument 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.cleanup
method with simplerconcast.beforeNext
API by @benjamn in #9718 - Implement minimal
useFragment
hook by @benjamn in #8782 - Fix
BatchHttpLink
regression that silently discarded some pending queries by @benjamn in #9793 - Delay execution of callback functions to fix React errors by @dylanwulf in #9801
- Return most recent result diff from useFragment, update test by @alessbell in #10030
- Supports "no-cache" fetchPolicy with pollInterval by @MrDoomBringer in #10020
- (Release 3.7) Rename useFragment -> useFragment_experimental by @MrDoomBringer in #10075
- Adds @defer support by @alessbell in #10018
- Improvements to the
hasDirectives
utility function by @benjamn in #10082 - chore: omit previousResult, lastCompleteResult from options/result by @alessbell in #10100
- Support header name capitalization by @MrDoomBringer in #9891
- Add onError option to useSubscription hook by @jeroenvisser101 in #9495
- Avoid letting
defaultDataIdFromObject
normalize objects with nullish ids by @benjamn in #9862 - Allow registering named fragments with
InMemoryCache
to support using...FragmentName
in queries without redeclaringFragmentName
in every query by @benjamn in #9764 - Fix various flaky tests before publishing
@apollo/[email protected]
by @benjamn in #10118 - Update handler names for useSubscription hook by @jerelmiller in #10134
- Add changes from #10134 to CHANGELOG.md by @jerelmiller in #10148
- Release 3.7.0 by @benjamn in #9633
New Contributors 🎉 🙌 🥳
- @jeroenvisser101 made their first contribution in #9495
- @jerelmiller made their first contribution in #10134
Full Changelog: v3.6.10...v3.7.0
v3.6.10
Improvements (from CHANGELOG.md
)
- The client options (
variables
,context
, etc.) used formutation
calls are now available as the second argument to theonCompleted
andonError
callback functions.
@MrDoomBringer in #10052
What's Changed
- adds a prettier ignore file by @jpvajda in #9809
- Fix documentation code snippets for SubscriptionClient by @jpikora in #9820
- Add a new maintainer (Yours Truly) to README by @MrDoomBringer in #9863
- Remove Ignoring errors sections in link and error handling docs. by @alessbell in #9854
- Update the getting started guide to use the FlyBy API by @rkoron007 in #9851
- Mockprovider docs updates by @jpvajda in #9867
- Updates testing docs to use Testing Library by @alessbell in #9888
- Clarify that id is optional on queries in cache.modify documentation by @MrDoomBringer in #9894
- Add defensive isMounted checks before setting state via useMutation Hook by @alessbell in #9883
- Add onQueryUpdate missing parameters by @capucho in #9898
- Type policy inheritance by @jpvajda in #9905
- Use reactive var hook by @jpvajda in #9906
- Remove jest-fetch-mock in favor of fetch-mock, update tests by @alessbell in #9928
- Minor edits to new useReactiveVar reference by @StephenBarlow in #9932
- Add the new CodeSandbox link by @rkoron007 in #9945
- Pin TypeDoc version in Netlify command by @trevorblades in #9950
- Fix TypeDoc generated file paths by @trevorblades in #9951
- Quick doc change to clarify subscriptions don't work in client schema by @MrDoomBringer in #9944
- Run React 17 + 18 tests on CI by @alessbell in #9942
- Roadmap update by @jpvajda in #9966
- chore: update renovate config and add .npmrc by @alessbell in #9967
- chore: update CONTRIBUTING.md by @alessbell in #9953
- Field policy merge docs by @jpvajda in #9969
- add link to solid.js github repo by @jpvajda in #9981
- Replace crypto-hash with a custom hashing function in tests by @hwillson in #9986
- adds broadcast false details by @jpvajda in #9978
- Use function declaration for
WithApolloClient
example by @charpeni in #9977 - docs: Update code block meta strings to make syntax highlighting work again by @trevorblades in #9985
- Fix updateQuery docs having incorrect function signature by @MrDoomBringer in #10002
- Correct error handling example in docs by @MrDoomBringer in #9996
- updates roadmap by @jpvajda in #10013
- adds solid.js to integrations.md by @jpvajda in #10014
- docs: fix React default import by @henryqdineen in #10036
- docs: remove errant duplicated text by @henryqdineen in #10046
- updates local resolver warning by @jpvajda in #10062
- GitHub Workflows security hardening by @sashashura in #10049
- Pass mutation options to handlers by @MrDoomBringer in #10052
- MissingFieldError once again extends Error by @MrDoomBringer in #10051
- Fix typos by @CompuWiser in #10045
- Documentation update for ApolloQueryResult by @MrDoomBringer in #10055
- docs: Update "Using Apollo with TypeScript" with a description of fetchMore and subscribeToMore by @bignimbus in #10066
- fix: make
react-dom
an optional peer dependency by @brillout in #9933 - adds defer docs by @jpvajda in #10079
- updates defer message by @jpvajda in #10088
- Make it clear that @defer is available by installing beta by @hwillson in #10096
- Better error message when failing to match mock variables by @zinkkrysty in #9921
- Export
Modifier
andModifiers
by @olyop in #8973 - chore(docs): add useFragment_experimental documentation by @alessbell in #10099
- Bump up timeout time for batchLink, query and polling tests by @MrDoomBringer in #10097
- remove obsolete displayName query option by @henryqdineen in #10044
- docs: fixup onResetStore docs, convert to hooks by @henryqdineen in #10047
- changes beta to next by @jpvajda in #10119
- local-state-management AC2 LocalState side note by @MrDoomBringer in #10112
- Fix for ServerError obscured by ServerParseError by @dillontiner in #9997
- Remove conditional require()s from SSR by @MrDoomBringer in #9975
- chore(docs): use optional chaining rather than non-null assertion by @charpeni in #10129
- chore(tests): use node v16.10.0 for jest tests due to memory leaks in 16.11+ by @alessbell in #10140
- docs: Fix typo by @Javokhir12 in #10128
New Contributors
- @jpikora made their first contribution in #9820
- @capucho made their first contribution in #9898
- @charpeni made their first contribution in #9977
- @sashashura made their first contribution in #10049
- @CompuWiser made their first contribution in #10045
- @bignimbus made their first contribution in #10066
- @brillout made their first contribution in #9933
- @zinkkrysty made their first contribution in #9921
- @olyop made their first contribution in #8973
- @dillontiner made their first contribution in #9997
- @Javokhir12 made their first contribution in #10128
Full Changelog: v3.6.9...v.3.6.10