post.byId reads as “the post.byId query” with the input it takes and the steps of its resolver. Middleware reads as checks that run before a procedure, and TRPCError codes are named together with their HTTP status. On the client, calls read as running a query or a mutation by path.
.input(...) reads as the shape it accepts.
The plugin declares library: { name: "@trpc/server", versions: ">=10 <12" } and reads both v10 and v11. It narrates files that import from an @trpc/* package, files that import a tRPC setup module (for example a ~/server/trpc file or names like publicProcedure), and files in a package that depends on tRPC (see Dependency detection).
Examples
A router with procedures
English
Middleware
English
The vanilla client
English
What it covers
- Setup:
initTRPCwith its context, meta and options, and the exportedrouter,procedureandmiddlewarebuilders. - Routers: nested routers with dotted paths,
mergeRouters,createCallerFactory, and procedures built frominput,output,use,meta,query,mutationandsubscription. - Middleware that checks the context and calls
next({ ctx }), andTRPCErrorwith its code and status. - Adapters such as
fetchRequestHandler,createHTTPServer,createNextApiHandlerandcreateExpressMiddleware. - Clients:
createTRPCClientand its links,createTRPCReacthooks (useQuery,useMutation,useUtilsand the cache helpers),skipToken, and the TanStack integration’squeryOptionsandmutationOptionshelpers, which the TanStack Query plugin reads as queries.
Translating
The English phrasebook is exported asen and typed as TrpcPhrases.