Open History to see the last commit
1---
2id: provideQueryClient
3title: provideQueryClient
4---
5β
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7β
8# Function: provideQueryClient()
9β
10```ts
11function provideQueryClient(queryClient): Provider
12```
13β
14Defined in: [providers.ts:14](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L14)
15β
16Usually [provideTanStackQuery](../providetanstackquery.md) is used once to set up TanStack Query and the
17[https://tanstack.com/query/latest/docs/reference/QueryClient\|QueryClient](https://tanstack.com/query/latest/docs/reference/QueryClient|QueryClient)
18for the entire application. Internally it calls `provideQueryClient`.
19You can use `provideQueryClient` to provide a different `QueryClient` instance for a part
20of the application or for unit testing purposes.
21β
22## Parameters
23β
24### queryClient
25β
26A `QueryClient` instance, or an `InjectionToken` which provides a `QueryClient`.
27β
28`QueryClient` | `InjectionToken`\<`QueryClient`\>
29β
30## Returns
31β
32`Provider`
33β
34a provider object that can be used to provide the `QueryClient` instance.