Major Changes
-
#12776
bce9b74
Thanks @jerelmiller! - Report masked fragments as complete even when a nested masked fragment contains partial data. -
#12774
511b4f3
Thanks @jerelmiller! - Apply document transforms before reading data from the cache forclient.readQuery
,client.readFragment
,client.watchFragment
,useFragment
, anduseSuspenseFragment
.NOTE: This change does not affect the equivalent
cache.*
APIs. To read data from the cache without first running document transforms, runcache.readQuery
,cache.readFragment
, etc.
Minor Changes
- #12776
bce9b74
Thanks @jerelmiller! - AdddataState
to the value emitted fromclient.watchFragment
.
Patch Changes
-
#12776
bce9b74
Thanks @jerelmiller! -cache.watchFragment
now returns anUnmasked<TData>
result sincecache.watchFragment
does not mask fragment spreads. -
#12370
0517163
Thanks @phryneas! -InMemoryCache
: Fields with an empty argument object are now saved the same way as fields without arguments.Previously, it was possible that the reponses for these two queries would be stored differently in the cache:
query PlainAccess { myField }
would be stored as
myField
andquery AccessWithoutOptionalArgument($optional: String) { myField(optional: $optional) }
would be stored as
myField({"optional":"Foo"})
if called with{optional: "Foo"}
and asmyField({})
if called without the optional argument.The cases
myField
andmyField({})
are equivalent from the perspective of a GraphQL server, and so in the future both of these will be stored asmyField
in the cache. -
#12775
454ec78
Thanks @jerelmiller! - Don't exportgql
from@apollo/client/react
entrypoint. Import from@apollo/client
instead. -
#12761
db6f7c3
Thanks @phryneas! - Deprecate second argument toreadFragment
andreadQuery
-optimistic
should be passed as part of the object in the first argument instead.