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