Major Changes
- Add improved error awareness to Graphcache. When Graphcache now receives a
GraphQLError
(via aCombinedError
) it checks whether theGraphQLError
'spath
matches up withnull
values in thedata
. Anynull
values that the write operation now sees in the data will be replaced with a "cache miss" value (i.e.undefined
) when it has an associated error. This means that errored fields from your GraphQL API will be marked as uncached and won't be cached. Instead the client will now attempt a refetch of the data so that errors aren't preventing future refetches or with schema awareness it will attempt a refetch automatically. Additionally, theupdates
functions will now be able to check whether the current field has any errors associated with it withinfo.error
, by @kitten (See #1356)
Minor Changes
- Allow
schema
option to be passed with a partial introspection result that only containsqueryType
,mutationType
, andsubscriptionType
with their respective names. This allows you to pass{ __schema: { queryType: { name: 'Query' } } }
and the likes to Graphcache'scacheExchange
to alter the default root names without enabling full schema awareness, by @kitten (See #1379)