Releases: apollographql/apollo-client
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
v3.6.9
Bug Fixes (from CHANGELOG.md
)
- Leave
fetchPolicy
unchanged whenskip: true
(or in standby) andnextFetchPolicy
is available, even ifvariables
change.
@benjamn in #9823
What's Changed
- removes deprecation language by @jpvajda in #9825
- Leave
fetchPolicy
unchanged whenskip: true
(or in standby) andnextFetchPolicy
is available by @benjamn in #9823
Full Changelog: v3.6.8...v3.6.9
v3.6.8
Bug Fixes (from CHANGELOG.md
)
-
Fix incorrect
variables
passed inFieldFunctionOptions
for nestedreadField
calls inread
andmerge
functions.
@stardustxx in #9808 -
Improve repository build scripts to work better on Windows.
@dylanwulf in #9805 -
Ensure
useQuery(query, { skip: true }).called === false
rather than always returningcalled
astrue
.
@KucharskiPiotr in #9798 -
Allow abandoned
reobserve
requests 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 #9808
- Fix build config to work on Windows by @dylanwulf in #9805
- Fix: useQuery returns called value based on skip option. by @KucharskiPiotr in #9798
- fix: abort stale connection on reobserve (#9532) by @javier-garcia-meteologica in #9791
New Contributors 🎉 🙌 🥳
- @stardustxx made their first PR in #9808
- @dylanwulf made their first PR in #9805
- @KucharskiPiotr made their first PR in #9798
Full Changelog: v3.6.7...v3.6.8
v3.6.7
Bug Fixes (from CHANGELOG.md
)
- Fix regression (introduced in v3.6.0) that caused
BatchHttpLink
to 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 #9776
- Update mutations.mdx by @Gregoirevda in #9708
- updates roadmap for june 2022 by @jpvajda in #9784
- fixes expansion panel by @jpvajda in #9777
- Backport PR #9793 from
release-3.7
branch tomain
by @benjamn in #9807
Full Changelog: v3.6.6...v3.6.7