MCPcopy
hub / github.com/TanStack/query / getQueryClientContext

Function getQueryClientContext

packages/svelte-query/src/context.ts:9–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8/** Retrieves a Client from Svelte's context */
9export const getQueryClientContext = (): QueryClient => {
10 const client = getContext(_contextKey)
11 if (!client) {
12 throw new Error(
13 'No QueryClient was found in Svelte context. Did you forget to wrap your component with QueryClientProvider?',
14 )
15 }
16
17 return client as QueryClient
18}
19
20/** Sets a QueryClient on Svelte's context */
21export const setQueryClientContext = (client: QueryClient): void => {

Callers 1

useQueryClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…