@apollo/client@4.0.0-rc.1
Pre-releaseMajor Changes
-
#12735
5159880
Thanks @jerelmiller! - Remove deprecatedresultCacheMaxSize
option fromInMemoryCache
options. -
#12735
5159880
Thanks @jerelmiller! - Remove deprecatedconnectToDevtools
option fromApolloClientOptions
. Usedevtools.enabled
instead.
Minor Changes
-
#12725
89ac725
Thanks @jerelmiller! - AddoperationType
tooperation
inApolloLink
. This means that determining whether aquery
is a specific operation type can now be compared with this property instead of usinggetMainDefinition
.- import { getMainDefinition } from "@apollo/client/utilities"; + import { OperationTypeNode } from "graphql"; ApolloLink.split( - ({ query }) => { - const definition = getMainDefinition(query); - return ( - definition.kind === 'OperationDefinition' && - definition.operation === 'subscription' - ); - return - }, + ({ operationType }) => { + return operationType === OperationTypeNode.SUBSCRIPTION; + }, conditionTrueLink, conditionFalseLink, );
Patch Changes
-
#12728
07a0c8c
Thanks @jerelmiller! - Export theIgnoreModifier
type from@apollo/client/cache
. -
#12735
5159880
Thanks @jerelmiller! - Change theunsafePreviousData
argument onUpdateQueryMapFn
andSubscribeToMoreQueryFn
to aDeepPartial
since the result may contain partial data. -
#12734
037979d
Thanks @jerelmiller! - Don't warn about a missing resolver if a@client
does not have a configured resolver. It is possible the cache contains aread
function for the field and the warning added confusion.Note that
read
functions without a defined resolver will receive theexisting
argument asnull
instead ofundefined
even when data hasn't been written to the cache. This is becauseLocalState
sets a default value ofnull
when a resolver is not defined to ensure that the field contains a value in case aread
function is not defined rather than omitting the field entirely. -
#12725
89ac725
Thanks @jerelmiller! - ExportgetMainDefinition
from@apollo/client/utilities
. -
#12729
699c830
Thanks @jerelmiller! - EnsureuseQuery
rerenders whennotifyOnNetworkStatusChange
isfalse
and arefetch
that changes variables returns a result deeply equal to previous variables.