Add an option to output Zod schema with generated payload-types #4259
hades200082
started this conversation in
Feature Requests & Ideas
Replies: 2 comments 1 reply
-
This would be super useful for using payload in conjunction with trpc procedure input parameters. Api parameters and database rows are often pretty tightly coupled. publicProcedure
.input(PostCollectionSchema.pick({ title: true, body:true }))
.mutation(async ({ ctx, input }) => {
// input.title
// input.body
}) |
Beta Was this translation helpful? Give feedback.
1 reply
-
This would be a take Payload to another level, super helpful with forms too |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When generating payload-types.ts it would be nice if we could have the option to also output the associated Zod schemas as well.
I've tried using ts-to-zod and @runtyping/zod to generate zod schemas but keep running into invalid union errors. :(
Beta Was this translation helpful? Give feedback.
All reactions