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.
1 parent 2d42b37 commit 4be270bCopy full SHA for 4be270b
1 file changed
packages/orm/src/client/zod/factory.ts
@@ -1034,7 +1034,7 @@ export class ZodSchemaFactory<
1034
private makeDistinctSchema(model: string) {
1035
const modelDef = requireModel(this.schema, model);
1036
const nonRelationFields = Object.keys(modelDef.fields).filter((field) => !modelDef.fields[field]?.relation);
1037
- return this.orArray(z.enum(nonRelationFields as any), true);
+ return nonRelationFields.length > 0 ? this.orArray(z.enum(nonRelationFields as any), true) : z.never();
1038
}
1039
1040
private makeCursorSchema(model: string) {
0 commit comments