meowM
tRPC3y ago
3 replies
meow

TypeScript type for request object for route handlers

So far I've been writing my routes like:

export const router = t.router({
  helloWorld: t.procedure.query(async (req) => "Hello World"),
})


What would be the type for req if I wanted to extract my handlers like so:

const handler = async (req:?) => "Hello World"

export const router = t.router({
  helloWorld: t.procedure.query(hander)
})
Was this page helpful?