I am working on a large app and have noticed performance degrade over time.
From inspecting the cache I can see over 20,000 watches in the cache:
InMemoryCache2 {watches: Set(21126), typenameDocumentCache: Map(286), txCount: 0, getFragmentDoc: ƒ, makeVar: ƒ, …}
The watches don’t appear to get garbage collected when the component that called useQuery
is unmounted so the watches Set
just increases in size over time.
Is this expected behaviour?
And is there way to remove watches on unmount, or trigger a garbage collect somehow?
Thanks