-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pure model schema? #43
Comments
It might be similar to what |
i saw code generated zod is already contain optional for create. but I find issue with findUnique as well due to "distinct".
|
I mean a zod object that just contains what prisma model has. For example, model ExampleModel {
id String @id @default(uuid())
name String?
} Then what I want is: z.object({
id: z.string(),
name: z.string().optional(),
}); In Create schema, |
@lilingxi01 you could try my new generator that I just published zod-prisma-types that lets you just create the |
Problem
Does this library generate pure model schema? It should be, for example, the output of
findUnique
(not the argument offindUnique
). I try to find this, but cannot find any file having such thing (probably missed in tons of files).Suggested solution
Just generate the zod based on the model itself. Similar to the output of zod-prisma.
The text was updated successfully, but these errors were encountered: