Skip to main content

Module: @ts-rest/react-query

Interfaces

Type Aliases

DataResponse

Ƭ DataResponse<TAppRoute>: ClientInferResponses<TAppRoute, SuccessfulHttpStatusCode, "force">

Type parameters

NameType
TAppRouteextends AppRoute

Defined in

react-query/src/v4/types.ts:24


ErrorResponse

Ƭ ErrorResponse<TAppRoute, TIncludeThrownErrors>: ClientInferResponses<TAppRoute, ErrorHttpStatusCode, "ignore"> | TIncludeThrownErrors extends true ? Error : never

Type parameters

NameType
TAppRouteextends AppRoute
TIncludeThrownErrorsextends boolean | undefined = false

Defined in

react-query/src/v4/types.ts:31


InitClientReturn

Ƭ InitClientReturn<T, TClientArgs>: UseTsRestQueryClient<T, TClientArgs>

Deprecated

Use TsRestReactQueryClient instead

Type parameters

NameType
Textends AppRouter
TClientArgsextends ReactQueryClientArgs

Defined in

react-query/src/v4/react-query.ts:157


TsRestReactQueryClient

Ƭ TsRestReactQueryClient<T, TClientArgs>: { [TKey in keyof T]: T[TKey] extends AppRoute ? Without<AppRouteFunctions<T[TKey], TClientArgs>, never> : T[TKey] extends AppRouter ? TsRestReactQueryClient<T[TKey], TClientArgs> : never }

Type parameters

NameType
Textends AppRouter
TClientArgsextends ReactQueryClientArgs

Defined in

react-query/src/v4/react-query.ts:162


UseInfiniteQueryOptions

Ƭ UseInfiniteQueryOptions<TAppRoute, TData, TIncludeThrownErrors>: TanStackUseInfiniteQueryOptions<DataResponse<TAppRoute>, ErrorResponse<TAppRoute, TIncludeThrownErrors>, TData>

Type parameters

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>
TIncludeThrownErrorsextends boolean | undefined = false

Defined in

react-query/src/v4/types.ts:57


UseInfiniteQueryResult

Ƭ UseInfiniteQueryResult<TAppRoute, TData, TIncludeThrownErrors>: TanStackUseInfiniteQueryResult<TData, ErrorResponse<TAppRoute, TIncludeThrownErrors>>

Type parameters

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>
TIncludeThrownErrorsextends boolean | undefined = false

Defined in

react-query/src/v4/types.ts:67


UseMutationOptions

Ƭ UseMutationOptions<TAppRoute, TClientArgsOrClient, TClientArgs>: TanStackUseMutationOptions<DataResponse<TAppRoute>, ErrorResponse<TAppRoute, TClientArgs["includeThrownErrorsInErrorType"]>, PartialClientInferRequest<TAppRoute, TClientArgs>, unknown>

Type parameters

NameType
TAppRouteextends AppRoute
TClientArgsOrClientextends ReactQueryClientArgs | TsRestReactQueryClient<any, any>
TClientArgsextends ReactQueryClientArgs = GetClientArgs<TClientArgsOrClient>

Defined in

react-query/src/v4/types.ts:91


UseMutationResult

Ƭ UseMutationResult<TAppRoute, TClientArgsOrClient, TClientArgs>: TanStackUseMutationResult<DataResponse<TAppRoute>, ErrorResponse<TAppRoute, TClientArgs["includeThrownErrorsInErrorType"]>, PartialClientInferRequest<TAppRoute, TClientArgs>, unknown>

Type parameters

NameType
TAppRouteextends AppRoute
TClientArgsOrClientextends ReactQueryClientArgs | TsRestReactQueryClient<any, any>
TClientArgsextends ReactQueryClientArgs = GetClientArgs<TClientArgsOrClient>

Defined in

react-query/src/v4/types.ts:104


UseQueryOptions

Ƭ UseQueryOptions<TAppRoute, TData, TIncludeThrownErrors>: TanStackUseQueryOptions<DataResponse<TAppRoute>, ErrorResponse<TAppRoute, TIncludeThrownErrors>, TData>

Type parameters

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>
TIncludeThrownErrorsextends boolean | undefined = false

Defined in

react-query/src/v4/types.ts:38


UseQueryResult

Ƭ UseQueryResult<TAppRoute, TData, TIncludeThrownErrors>: TanStackUseQueryResult<TData, ErrorResponse<TAppRoute, TIncludeThrownErrors>>

Type parameters

NameType
TAppRouteextends AppRoute
TDataDataResponse<TAppRoute>
TIncludeThrownErrorsextends boolean | undefined = false

Defined in

react-query/src/v4/types.ts:48


UseTsRestQueryClient

Ƭ UseTsRestQueryClient<T, TClientArgs>: { [TKey in keyof T]: T[TKey] extends AppRoute ? Without<AppRouteFunctionsWithQueryClient<T[TKey], TClientArgs>, never> : T[TKey] extends AppRouter ? UseTsRestQueryClient<T[TKey], TClientArgs> : never }

Type parameters

NameType
Textends AppRouter
TClientArgsextends ReactQueryClientArgs

Defined in

react-query/src/v4/react-query.ts:333

Functions

initQueryClient

initQueryClient<T, TClientArgs>(router, clientArgs): TsRestReactQueryClient<T, TClientArgs>

Type parameters

NameType
Textends AppRouter
TClientArgsextends ReactQueryClientArgs

Parameters

NameType
routerT
clientArgsTClientArgs

Returns

TsRestReactQueryClient<T, TClientArgs>

Defined in

react-query/src/v4/react-query.ts:175


useTsRestQueryClient

useTsRestQueryClient<T, TClientArgs>(client): UseTsRestQueryClient<T, TClientArgs>

Type parameters

NameType
Textends AppRouter
TClientArgsextends ReactQueryClientArgs

Parameters

NameType
clientTsRestReactQueryClient<T, TClientArgs>

Returns

UseTsRestQueryClient<T, TClientArgs>

Defined in

react-query/src/v4/react-query.ts:344