tRPC Input from a Prisma Schema

Is there any way to tell tRPC (zod technically i guess) to expect a tRPC schema as a type? like procedure.input({myType: z.tRPC(myType)}).query() or something
6 Replies
Neto
Neto3y ago
why would you need that?
amanuel
amanuel3y ago
Then he doesn't need to rewrite the type definition? I don't know the answer to this Op
Neto
Neto3y ago
i can list some reasons that you dont want to 1:1 input and schemas but if you really want to
Neto
Neto3y ago
npm
zod-prisma
A Prisma generator that creates Zod schemas for all of your models. Latest version: 0.5.4, last published: 10 months ago. Start using zod-prisma in your project by running npm i zod-prisma. There are 2 other projects in the npm registry using zod-prisma.
amanuel
amanuel3y ago
That's a whole different discussion, but you asked why hahahahaha Mainly due to null/undefined bs I just do my own validation
alexjyoung
alexjyoungOP3y ago
no yeah agreed, its definitely not the ideal in a lot of situations great thakn you
Want results from more Discord servers?
Add your server