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
Neto2y ago
why would you need that?
amanuel
amanuel2y ago
Then he doesn't need to rewrite the type definition? I don't know the answer to this Op
Neto
Neto2y ago
i can list some reasons that you dont want to 1:1 input and schemas but if you really want to
Neto
Neto2y 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
amanuel2y 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
alexjyoung2y 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