web-data-fetching-trpc
Installation
SKILL.md
tRPC Patterns
Quick Guide: tRPC carries types from server to client through one exported type rather than through a generated schema, so
export type AppRouter = typeof appRouteris the whole bridge and everything downstream fails without it. Procedures take a validated input and return a value;TRPCErrorcodes are what become HTTP statuses; middleware narrows the context type so an authenticated procedure'sctx.useris non-nullable. In v11 the transformer moved inside the link, subscriptions are async generators, and@trpc/tanstack-react-queryis the current React integration.
Detailed Resources:
- examples/core.md — initialization, context, a CRUD router, the provider, inferred types,
queryOptions - examples/middleware.md — logging, rate limiting, resource-scoped access
- examples/infinite-queries.md — cursor pagination end to end
- examples/optimistic-updates.md — the full snapshot-and-rollback cycle
- examples/subscriptions.md — async generator subscriptions with resumable event ids
- examples/file-uploads.md —
Filein an input schema (v11+) - reference.md — error code to HTTP status table, batching and invalidation notes, v10 → v11 migration