Minor Changes
-
#11345
1759066a8Thanks @phryneas! -QueryManager.inFlightLinkObservablesnow uses a strongTrieas an internal data structure.Warning: requires
@apollo/experimental-nextjs-app-supportupdateIf 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
a8158733cThanks @jerelmiller! - Introduces a newuseLoadableQueryhook. This hook works similarly touseBackgroundQueryin that it returns aqueryRefthat can be used to suspend a component via theuseReadQueryhook. 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
cc4ac7e19Thanks @phryneas! - Fix a potential memory leak inFragmentRegistry.transformandFragmentRegistry.findFragmentSpreadsthat would hold on to passed-inDocumentNodesfor too long. -
#11370
25e2cb431Thanks @phryneas! -parsefunction: improve memory management- use LRU
WeakCacheinstead ofMapto keep a limited number of parsed results - cache is initiated lazily, only when needed
- expose
parse.resetCache()method
- use LRU
-
#11389
139acd115Thanks @phryneas! -documentTransform: useoptimismandWeakCacheinstead of directly storing data on theTrie -
#11358
7d939f80fThanks @phryneas! - Fixes a potential memory leak inConcastthat might have been triggered whenConcastwas used outside of Apollo Client. -
#11344
bd2667619Thanks @phryneas! - Add aresetCachemethod toDocumentTransformand hookInMemoryCache.addTypenameTransformup toInMemoryCache.gc -
#11367
30d17bfebThanks @phryneas! -print: useWeakCacheinstead ofWeakMap -
#11385
d9ca4f082Thanks @phryneas! - ensuredefaultContextis also used for mutations and subscriptions -
#11387
4dce8673bThanks @phryneas! -QueryManager.transformCache: useWeakCacheinstead ofWeakMap -
#11371
ebd8fe2c1Thanks @phryneas! - Clarify types ofEntityStore.makeCacheKey. -
#11355
7d8e18493Thanks @phryneas! - InMemoryCache.gc now also triggers FragmentRegistry.resetCaches (if there is a FragmentRegistry)