Open History to see the last commit
1---
2id: useQueryClient
3title: useQueryClient
4---
5β
6```ts
7function useQueryClient(): QueryClient;
8```
9β
10Defined in: [packages/lit-query/src/context.ts:105](https://github.com/TanStack/query/blob/main/packages/lit-query/src/context.ts#L105)
11β
12Resolves the current default `QueryClient` registered by a connected
13`QueryClientProvider`.
14β
15This helper is useful outside a Lit reactive controller when a single
16provider is mounted. It throws if no client is registered or if multiple
17clients are mounted and the default would be ambiguous.
18β
19## Returns
20β
21[`QueryClient`](../classes/QueryClient.md)
22β
23The single registered query client.
24β
25## Throws
26β
27If no `QueryClient` is registered, or if multiple are
28mounted and the default is ambiguous.