diff --git a/src/queryCache.js b/src/queryCache.js index 3bc1e787d9..248c48c7e0 100644 --- a/src/queryCache.js +++ b/src/queryCache.js @@ -308,6 +308,7 @@ export function makeQueryCache({ frozen = isServer, defaultConfig } = {}) { } query.scheduleGarbageCollection = () => { + if (!queryCache.queries[query.queryHash]) return if (query.config.cacheTime === Infinity) { return }