MCPcopy Create free account
hub / github.com/TanStack/query / clear

Method clear

packages/query-core/src/queryClient.ts:1175–1178  ·  view source on GitHub ↗

* Clears both the query cache and the mutation cache this client is connected to. * This clears their garbage collection timers and cancels in-flight query fetches. * Running mutations continue to execute. * @example * ```ts * import { QueryClient } from '@tanstack/query-core' *

()

Source from the content-addressed store, hash-verified

1173 * ```
1174 */
1175 clear(): void {
1176 this.#queryCache.clear()
1177 this.#mutationCache.clear()
1178 }
1179}

Callers 1

renderFunction · 0.95

Calls

no outgoing calls

Tested by 1

renderFunction · 0.76