# use-q > An opinionated, schema-driven way to use TanStack Query v5 — TkDodo's Practical React Query patterns as a typed API client. use-q is a typed API client on TanStack Query v5. Fetch this index first, then follow links to Markdown pages. Prefer `/llms-full.txt` when you need the complete corpus in one request. Packages: `@use-q/api-client` (zero-dependency core), `@use-q/api-client-react` (hooks), `@use-q/api-client-codegen` (OpenAPI → schema). ## Getting Started - [Introduction](https://use-q.dev/docs.md): use-q is an opinionated, schema-driven way to use TanStack Query v5 — TkDodo's Practical React Query patterns as a typed API client. - [Practical React Query](https://use-q.dev/docs/getting-started/practical-react-query.md): use-q is an opinionated way to use TanStack Query — TkDodo's Practical React Query series, encoded as a schema-driven client. - [Installation](https://use-q.dev/docs/getting-started/installation.md): Install use-q and its React bindings with pnpm, npm, or yarn. - [Quick Start](https://use-q.dev/docs/getting-started/quick-start.md): Build a type-safe list + create flow with use-q in five minutes. - [Schema Definition](https://use-q.dev/docs/getting-started/schema-definition.md): Anatomy of a RouteDefinition — every field, with examples. ## Core - [createFetcher](https://use-q.dev/docs/core/create-fetcher.md): Use the framework-agnostic fetcher from @use-q/api-client standalone — in Node CLIs, edge workers, RSC, and server actions. - [Error Handling](https://use-q.dev/docs/core/error-handling.md): ApiError, isApiError, custom parseError shapes, and global error hooks. - [OpenAPI Codegen](https://use-q.dev/docs/core/codegen.md): Generate a typed RouteDefinition map from an OpenAPI 3.x spec with use-q-codegen. ## React - [createApiClient](https://use-q.dev/docs/react/create-api-client.md): createApiClient(schema, options) — turn a schema into hooks, utilities, and a typed cache. - [useQ](https://use-q.dev/docs/react/use-q.md): Fetch a route as a typed query. select, enabled, staleTime, refetchInterval, and more. - [useM](https://use-q.dev/docs/react/use-m.md): Type-safe mutations with optimistic updates, multi-target snapshots, and automatic tag invalidation. - [useInfiniteQ](https://use-q.dev/docs/react/use-infinite-q.md): Infinite/paginated queries with schema-driven pageParam, getNextPageParam, and aggregated pages. - [useSuspenseQ](https://use-q.dev/docs/react/use-suspense-q.md): Suspense-friendly query hook for use with and . - [useQClient](https://use-q.dev/docs/react/use-q-client.md): Imperative cache control — invalidate by tag or key, prefetch, setData, updateData, and more. - [ApiErrorBoundary](https://use-q.dev/docs/react/api-error-boundary.md): A typed React error boundary for use with useSuspenseQ. fallback signature, reset semantics, and ApiError narrowing. ## Guides - [Query Keys](https://use-q.dev/docs/guides/query-keys.md): How use-q structures TanStack Query keys for prefix-based invalidation and predictable caching. - [Tag Invalidation](https://use-q.dev/docs/guides/tag-invalidation.md): TagRegistry lifecycle, static vs dynamic tags, schema invalidatesTags, additionalInvalidatesTags, and why invalidation runs in onSettled. - [Optimistic Updates](https://use-q.dev/docs/guides/optimistic-updates.md): Multi-target optimistic patterns — list insert, item update, list delete — with snapshot/rollback semantics. - [Bring Your Own QueryClient](https://use-q.dev/docs/guides/byo-query-client.md): Share a single QueryClient across multiple createApiClient instances, persistence, and devtools. - [SSR & Loaders](https://use-q.dev/docs/guides/ssr-and-loaders.md): Use the raw fetcher in React Router, TanStack Router, Next.js server components, and server actions — and hydrate into the client cache. - [Monorepo Usage](https://use-q.dev/docs/guides/monorepo-usage.md): Place the schema in a shared @org/api-schema package, share with web and CLI consumers, and wire up codegen. ## API Reference - [RouteDefinition](https://use-q.dev/docs/api-reference/route-definition.md): Complete type reference for RouteDefinition — every field, generics, Tag, and PaginationDef variants. - [createFetcher Options](https://use-q.dev/docs/api-reference/create-fetcher-options.md): Every option accepted by createFetcher — type, default, and example. - [createApiClient Options](https://use-q.dev/docs/api-reference/create-api-client-options.md): Every option accepted by createApiClient — extends CreateFetcherOptions with queryClient. ## Optional - [Complete documentation](https://use-q.dev/llms-full.txt): Every page concatenated into one Markdown file. - [HTML documentation](https://use-q.dev/docs/): Human-readable docs site. - [GitHub](https://github.com/rithviknishad/use-q)