v3.1.0
版本发布时间: 2020-07-29 00:17:14
apollographql/apollo-client最新发布版本:v3.12.0-alpha.0(2024-10-02 04:16:11)
Apollo Client 3.1.0
Bug Fixes
-
Rework interdependencies between
@apollo/client/*
entry points, so that CommonJS and ESM modules are supported equally well, without any duplication of shared code. @benjamn in #6656 and #6657 -
Tolerate
!==
callback functions (likeonCompleted
andonError
) inuseQuery
options, since those functions are almost always freshly evaluated each timeuseQuery
is called. @hwillson and @benjamn in #6588 -
Respect
context.queryDeduplication
if provided, and otherwise fall back toclient.deduplication
(as before). @igaloly in #6261 and @Kujawadl in #6526 -
Refactor
ObservableQuery#getCurrentResult
to reenable immediate delivery of warm cache results. As part of this refactoring, theApolloCurrentQueryResult
type was eliminated in favor ofApolloQueryResult
. @benjamn in #6710 -
Avoid clobbering
defaultOptions
withundefined
values. @benjamn in #6715
Improvements
-
Apollo Client will no longer modify
options.fetchPolicy
unless you passoptions.nextFetchPolicy
to request an explicit change inFetchPolicy
after the current request. Although this is technically a breaking change,options.nextFieldPolicy
makes it easy to restore the old behavior (by passingcache-first
). @benjamn in #6712, reverting #6353 -
Errors of the form
Invariant Violation: 42
thrown in production can now be looked up much more easily, by consulting the auto-generated@apollo/client/invariantErrorCodes.js
file specific to your@apollo/client
version. @benjamn in #6665 -
Make the
client
field of theMutationResult
type non-optional, since it is always provided. @glasser in #6617 -
Allow passing an asynchronous
options.renderFunction
togetMarkupFromTree
. @richardscarrott in #6576 -
Ergonomic improvements for
merge
andkeyArgs
functions in cache field policies. @benjamn in #6714
Apollo Client 3.0.2
Bug Fixes
- Avoid duplicating
graphql/execution/execute
dependency in CommonJS bundle for@apollo/client/link/schema
, fixinginstanceof
errors reported in #6621 and #6614. @benjamn in #6624