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

providequeryclient.md

27 lines819 Bytes

1---
2id: provideQueryClient
3title: provideQueryClient
4---
5​
6# Function: provideQueryClient()
7​
8```ts
9function provideQueryClient(value): Provider
10```
11​
12Usually [provideAngularQuery](provideangularquery.md) is used once to set up TanStack Query and the
13[https://tanstack.com/query/latest/docs/reference/QueryClient|QueryClient](https://tanstack.com/query/latest/docs/reference/QueryClient|QueryClient)
14for the entire application. You can use `provideQueryClient` to provide a
15different `QueryClient` instance for a part of the application.
16​
17## Parameters
18​
19β€’ **value**: `QueryClient` \| () => `QueryClient`
20​
21## Returns
22​
23`Provider`
24​
25## Defined in
26​
27[inject-query-client.ts:25](https://github.com/TanStack/query/blob/dac5da5416b82b0be38a8fb34dde1fc6670f0a59/packages/angular-query-experimental/src/inject-query-client.ts#L25)