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

provideQueryClient.md

32 lines1.0 KB

Function: provideQueryClient()

function provideQueryClient(queryClient): Provider[];

Defined in: providers.ts:81

Usually provideTanStackQuery is used once to set up TanStack Query and the https://tanstack.com/query/latest/docs/reference/QueryClient|QueryClient for the entire application. Internally it calls provideQueryClient. You can use provideQueryClient to provide a different QueryClient instance for a part of the application or for unit testing purposes.

Parameters

queryClient

A QueryClient instance, or an InjectionToken which provides a QueryClient.

QueryClient | InjectionToken<QueryClient>

Returns

Provider[]

Providers to register with the spread operator, e.g. providers: [...provideQueryClient(client)].