Automates the creation of type-safe TanStack Query hooks by wrapping them with ts-rest contract logic and fetchers.
// Source: https://github.com/ts-rest/ts-rest | License: MIT | Copyright 2022 Oliver Butler
// Provided via justclaw.it.com; keep this notice with the code.
import {
QueryFunctionContext,
QueryKey,
useInfiniteQuery,
useQueries,
useQuery,
QueryClient,
useSuspenseQuery,
useSuspenseQueries,
useSuspenseInfiniteQuery,
useMutation,
usePrefetchQuery,
usePrefetchInfiniteQuery,
QueryOptions,
skipToken,
} from '@tanstack/react-query';
import {
AppRoute,
AppRouter,
ClientArgs,
evaluateFetchApiArgs,
fetchApi,
getRouteQuery,
isAppRoute,
isAppRouteQuery,
isErrorResponse,
} from '@ts-rest/core';
import {
MutationHooks,
QueryHooks,
TsRestReactQueryHooksContainer,
TsRestInfiniteQueryOptions,
TsRestQueryOptions,
TsRestQueryClientFunctions,
TsRestRe
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key