Minor Changes
-
#12934
54ab6d9
Thanks @jerelmiller! - Don't set the fallback value of a@client
field tonull
when aread
function is defined. Instead theread
function will be called with anexisting
value ofundefined
to allow default arguments to be used to set the returned value.When a
read
function is not defined nor is there a defined resolver for the field, warn and set the value tonull
only in that instance. -
#12934
54ab6d9
Thanks @jerelmiller! - Add an abstractresolvesClientField
function toApolloCache
that can be used by caches to tellLocalState
if it can resolve a@client
field when a local resolver is not defined.LocalState
will emit a warning and set a fallback value ofnull
when no local resolver is defined andresolvesClientField
returnsfalse
, or isn't defined. Returningtrue
fromresolvesClientField
signals that a mechanism in the cache will set the field value. In this case,LocalState
won't set the field value.
Patch Changes
-
#12915
c97b145
Thanks @phryneas! - Create mechanism to add experimental features to Apollo Client -
#12934
54ab6d9
Thanks @jerelmiller! - EnsureLocalState
doesn't try to read from the cache when using ano-cache
fetch policy. -
#12934
54ab6d9
Thanks @jerelmiller! - Warn when using ano-cache
fetch policy without a local resolver defined.no-cache
queries do not read or write to the cache which meantno-cache
queries are silently incomplete when the@client
field value was handled by a cacheread
function.