Skip to main content

Module: @ts-rest/react-query

Type Aliases​

DataResponse​

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

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:21


ErrorResponse​

Ƭ ErrorResponse<TAppRoute>: ClientInferResponses<TAppRoute, ErrorHttpStatusCode, "ignore">

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:28


InitClientReturn​

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

Type parameters​

NameType
Textends AppRouter
TClientArgsextends ClientArgs

Defined in​

lib/react-query.ts:152


UseInfiniteQueryOptions​

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

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:42


UseInfiniteQueryResult​

Ƭ UseInfiniteQueryResult<TAppRoute>: TanStackUseInfiniteQueryResult<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>>

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:48


UseMutationOptions​

Ƭ UseMutationOptions<TAppRoute, TClientArgsOrClient>: TanStackUseMutationOptions<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>, TClientArgsOrClient extends ClientArgs ? PartialClientInferRequest<TAppRoute, TClientArgsOrClient> : TClientArgsOrClient extends InitClientReturn<any, any> ? PartialClientInferRequest<TAppRoute, InferClientArgs<TClientArgsOrClient>> : never, unknown>

Type parameters​

NameType
TAppRouteextends AppRoute
TClientArgsOrClientextends ClientArgs | InitClientReturn<any, any>

Defined in​

lib/types.ts:59


UseMutationResult​

Ƭ UseMutationResult<TAppRoute, TClientArgsOrClient>: TanStackUseMutationResult<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>, TClientArgsOrClient extends ClientArgs ? PartialClientInferRequest<TAppRoute, TClientArgsOrClient> : TClientArgsOrClient extends InitClientReturn<any, any> ? PartialClientInferRequest<TAppRoute, InferClientArgs<TClientArgsOrClient>> : never, unknown>

Type parameters​

NameType
TAppRouteextends AppRoute
TClientArgsOrClientextends ClientArgs | InitClientReturn<any, any>

Defined in​

lib/types.ts:73


UseQueryOptions​

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

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:34


UseQueryResult​

Ƭ UseQueryResult<TAppRoute>: TanStackUseQueryResult<DataResponse<TAppRoute>, ErrorResponse<TAppRoute>>

Type parameters​

NameType
TAppRouteextends AppRoute

Defined in​

lib/types.ts:37

Functions​

initQueryClient​

â–¸ initQueryClient<T, TClientArgs>(router, clientArgs): InitClientReturn<T, TClientArgs>

Type parameters​

NameType
Textends AppRouter
TClientArgsextends ClientArgs

Parameters​

NameType
routerT
clientArgsTClientArgs

Returns​

InitClientReturn<T, TClientArgs>

Defined in​

lib/react-query.ts:165


useTsRestQueryClient​

â–¸ useTsRestQueryClient<T, TClientArgs>(client): InitUseTsRestQueryClientReturn<T, TClientArgs>

Type parameters​

NameType
Textends AppRouter
TClientArgsextends ClientArgs

Parameters​

NameType
clientInitClientReturn<T, TClientArgs>

Returns​

InitUseTsRestQueryClientReturn<T, TClientArgs>

Defined in​

lib/react-query.ts:325