We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
z.optional()
z.nullish()
1 parent 5806a4d commit 17e91feCopy full SHA for 17e91fe
packages/schema/src/plugins/zod/utils/schema-gen.ts
@@ -144,15 +144,15 @@ export function makeFieldSchema(field: DataModelField) {
144
// field uses `auth()` in `@default()`, this was transformed into a pseudo default
145
// value, while compiling to zod we should turn it into an optional field instead
146
// of `.default()`
147
- schema += '.nullish()';
+ schema += '.optional()';
148
} else {
149
const schemaDefault = getFieldSchemaDefault(field);
150
if (schemaDefault !== undefined) {
151
schema += `.default(${schemaDefault})`;
152
}
153
154
if (field.type.optional) {
155
156
157
158
0 commit comments