Major Changes
-
#12675
8f1d974
Thanks @phryneas! -ObservableQuery
no longer has aqueryId
property.
ApolloClient.getObservableQueries
no longer returns aMap<string, ObservableQuery>
, but aSet<ObservableQuery>
. -
#12647
a70fac6
Thanks @phryneas! -ObservableQuery
s will now only be registered with theApolloClient
while they
have subscribers.That means that
ApolloClient.getObservableQueries
andApolloClient.refetchQueries
will only be able to return/refetch queries that have at least one subscriber.This changes the previous meaning of
active
andinactive
queries:inactive
queries are queries with a subscriber that are skipped from a
React hook or have afetchPolicy
ofstandby
active
queries are queries with at least one subscriber that are not skipped or instandby
.
ObservableQuery
s without subscribers but with an active ongoing network request
(e.g. caused by callingreobserve
) will be handled as if they had a subscriber
for the duration of the query. -
#12678
91a876b
Thanks @jerelmiller! -queryRef
s created bypreloadQuery
no longer have a.toPromise()
function. InsteadpreloadQuery
now has atoPromise
function that accepts a queryRef and will resolve when the underlying promise has been resolved.const queryRef = preloadQuery(query, options); - await queryRef.toPromise(); + await preloadQuery.toPromise(queryRef);
-
#12647
a70fac6
Thanks @phryneas! -ApolloClient.stop()
now cleans up more agressively to prevent memory leaks:- It will now unsubscribe all active
ObservableQuery
instances by emitting acompleted
event. - It will now reject all currently running queries with
"QueryManager stopped while query was in flight"
. - It will remove all queryRefs from the suspense cache.
- It will now unsubscribe all active