Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

getQueryClientContext.md

25 lines780 Bytes

1---
2id: getQueryClientContext
3title: getQueryClientContext
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8```ts
9function getQueryClientContext(): QueryClient;
10```
11​
12Defined in: [packages/svelte-query/src/context.ts:13](https://github.com/TanStack/query/blob/main/packages/svelte-query/src/context.ts#L13)
13​
14Retrieves the `QueryClient` set on Svelte's context by `QueryClientProvider` (or by
15[setQueryClientContext](setQueryClientContext.md) directly). This is what [useQueryClient](useQueryClient.md) calls internally.
16​
17## Returns
18​
19[`QueryClient`](../classes/QueryClient.md)
20​
21The `QueryClient` set on context, whether by `QueryClientProvider` or [setQueryClientContext](setQueryClientContext.md).
22​
23## Throws
24​
25If no `QueryClient` was found in context.