Creating zod insert schema from Query with relations
I am using a Query FindFirst, with multiple relations enabled. I can infer the schema from this using
Awaited<ReturnType<typeof myQuery['execute']>>
but this includes the ID field in the relational objects.
How can I create a type that matches the query schema, but minus the IDs in the relations?
Bonus question, how can I then use Zod to add this type into a zod schema object?0 Replies