Minor Changes
-
#11345
1759066a8
Thanks @phryneas! -QueryManager.inFlightLinkObservables
now uses a strongTrie
as an internal data structure.Warning: requires
@apollo/experimental-nextjs-app-support
updateIf you are using
@apollo/experimental-nextjs-app-support
, you will need to update that to at least 0.5.2, as it accesses this internal data structure. -
#11300
a8158733c
Thanks @jerelmiller! - Introduces a newuseLoadableQuery
hook. This hook works similarly touseBackgroundQuery
in that it returns aqueryRef
that can be used to suspend a component via theuseReadQuery
hook. It provides a more ergonomic way to load the query during a user interaction (for example when wanting to preload some data) that would otherwise be clunky withuseBackgroundQuery
.function App() { const [loadQuery, queryRef, { refetch, fetchMore, reset }] = useLoadableQuery(query, options); return ( <> <button onClick={() => loadQuery(variables)}>Load query</button> <Suspense fallback={<SuspenseFallback />}> {queryRef && <Child queryRef={queryRef} />} </Suspense> </> ); } function Child({ queryRef }) { const { data } = useReadQuery(queryRef); // ... }
Patch Changes
-
#11356
cc4ac7e19
Thanks @phryneas! - Fix a potential memory leak inFragmentRegistry.transform
andFragmentRegistry.findFragmentSpreads
that would hold on to passed-inDocumentNodes
for too long. -
#11370
25e2cb431
Thanks @phryneas! -parse
function: improve memory management- use LRU
WeakCache
instead ofMap
to keep a limited number of parsed results - cache is initiated lazily, only when needed
- expose
parse.resetCache()
method
- use LRU
-
#11389
139acd115
Thanks @phryneas! -documentTransform
: useoptimism
andWeakCache
instead of directly storing data on theTrie
-
#11358
7d939f80f
Thanks @phryneas! - Fixes a potential memory leak inConcast
that might have been triggered whenConcast
was used outside of Apollo Client. -
#11344
bd2667619
Thanks @phryneas! - Add aresetCache
method toDocumentTransform
and hookInMemoryCache.addTypenameTransform
up toInMemoryCache.gc
-
#11367
30d17bfeb
Thanks @phryneas! -print
: useWeakCache
instead ofWeakMap
-
#11385
d9ca4f082
Thanks @phryneas! - ensuredefaultContext
is also used for mutations and subscriptions -
#11387
4dce8673b
Thanks @phryneas! -QueryManager.transformCache
: useWeakCache
instead ofWeakMap
-
#11371
ebd8fe2c1
Thanks @phryneas! - Clarify types ofEntityStore.makeCacheKey
. -
#11355
7d8e18493
Thanks @phryneas! - InMemoryCache.gc now also triggers FragmentRegistry.resetCaches (if there is a FragmentRegistry)