v3.2.0
版本发布时间: 2020-09-15 02:51:47
apollographql/apollo-client最新发布版本:v3.12.0-alpha.0(2024-10-02 04:16:11)
Apollo Client 3.2.0
Bug Fixes
-
Use
options.nextFetchPolicy
internally to restore originalFetchPolicy
after polling withfetchPolicy: "network-only"
, so that polling does not interfere with normal query watching. @benjamn in #6893 -
Initialize
ObservableQuery
inupdateObservableQuery
even ifskip
istrue
. @mu29 in #6999 -
Prevent full reobservation of queries affected by optimistic mutation updates, while still delivering results from the cache. @benjamn in #6854
Improvements
-
In TypeScript, all APIs that take
DocumentNode
parameters now may alternatively takeTypeDocumentNode<Data, Variables>
. This type has the same JavaScript representation but allows the APIs to infer the data and variable types instead of requiring you to specify types explicitly at the call site. @dotansimha in #6720 -
Bring back an improved form of heuristic fragment matching, by allowing
possibleTypes
to specify subtype regular expression strings, which count as matches if the written result object has all the fields expected for the fragment. @benjamn in #6901 -
Allow
options.nextFetchPolicy
to be a function that takes the currentFetchPolicy
and returns a new (or the same)FetchPolicy
, makingnextFetchPolicy
more suitable for global use indefaultOptions.watchQuery
. @benjamn in #6893 -
Implement
useReactiveVar
hook for consuming reactive variables in React components. @benjamn in #6867 -
Move
apollo-link-persisted-queries
implementation to@apollo/client/link/persisted-queries
. Try running our automated imports transform to handle this conversion, if you're usingapollo-link-persisted-queries
. @hwillson in #6837 -
Disable feud-stopping logic after any
cache.evict
orcache.modify
operation. @benjamn in #6817 and #6898 -
Throw if
writeFragment
cannot identifyoptions.data
when nooptions.id
provided. @jcreighton in #6859 -
Provide
options.storage
object tocache.modify
functions, as provided toread
andmerge
functions. @benjamn in #6991 -
Allow
cache.modify
functions to returndetails.INVALIDATE
(similar todetails.DELETE
) to invalidate the current field, causing affected queries to rerun, even if the field's value is unchanged. @benjamn in #6991 -
Support non-default
ErrorPolicy
values (that is,"ignore"
and"all"
, in addition to the default value"none"
) for mutations and subscriptions, like we do for queries. @benjamn in #7003 -
Remove invariant forbidding a
FetchPolicy
ofcache-only
inObservableQuery#refetch
. @benjamn in ccb0a79a, fixing #6702
Apollo Client 3.1.5
Bug Fixes
Improvements
Apollo Client 3.1.4
Bug Fixes
-
Restrict root object identification to
ROOT_QUERY
(the ID corresponding to the rootQuery
object), allowingMutation
andSubscription
as user-defined types. @benjamn in #6914 -
Prevent crash when
pageInfo
and emptyedges
are received byrelayStylePagination
. @fracmak in #6918
Apollo Client 3.1.3
Bug Fixes
- Consider only
result.data
(rather than all properties ofresult
) when settling cache feuds. @danReynolds in #6777
Improvements
- Provide jscodeshift transform for automatically converting Apollo Client 2.x
import
declarations to use Apollo Client 3.x packages. Instructions. @dminkovsky and @jcreighton in #6486