Change from nullable to optional #182
-
model MyModel {
id String @id @unique @default(cuid())
name String
description String?
} generates export const MyModelSchema = z.object({
id: z.string().cuid(),
name: z.string(),
description: z.string().nullable(),
}) for the |
Beta Was this translation helpful? Give feedback.
Answered by
chrishoermann
Aug 20, 2023
Replies: 1 comment 1 reply
-
can you try generator zod {
// ...rest of config
writeNullishInModelTypes = true
} as mentioned in the docs and see if |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Schmell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you try
as mentioned in the docs and see if
.nullish()
is sufficient?