You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description and expected behavior
Given the following schema:
enum FooType {
Bar
Baz
}
model User {
id String @id @default(cuid())
userFolders UserFolder[]
}
model Foo {
id String @id @default(cuid())
type FooType
userFolders UserFolder[]
@@delegate(type)
}
model Bar extends Foo {
name String
}
model Baz extends Foo {
age Int
}
model UserFolder {
id String @id @default(cuid())
userId String
fooId String
path String
user User @relation(fields: [userId], references: [id])
foo Foo @relation(fields: [fooId], references: [id])
@@unique([userId, fooId])
}
An invalid Zod schema is generated for UserFolderWhereUniqueInputObjectSchema
This schema attempts to import CompoundUniqueInput schemas for userId_delegate_aux_UserFolder_fooId_Bar/Baz, but these are removed during schema generation, causing a runtime error when these schemas are used.
Screenshots
Environment (please complete the following information):
ZenStack version: 12.2.1
Prisma version: 6.4.1
Database type: Postgresql
Additional context
The bug seems to be within the zod schema generator, where .startsWith(DELEGATE_AUX_RELATION_PREFIX) is still used instead of .includes(DELEGATE_AUX_RELATION_PREFIX) to filter delegate fields on an object. The CompoundUniqueInput schemas are filtered out correctly.
The text was updated successfully, but these errors were encountered:
Description and expected behavior
Given the following schema:
An invalid Zod schema is generated for
UserFolderWhereUniqueInputObjectSchema
This schema attempts to import CompoundUniqueInput schemas for
userId_delegate_aux_UserFolder_fooId_Bar/Baz
, but these are removed during schema generation, causing a runtime error when these schemas are used.Screenshots
Environment (please complete the following information):
Additional context
The bug seems to be within the zod schema generator, where
.startsWith(DELEGATE_AUX_RELATION_PREFIX)
is still used instead of.includes(DELEGATE_AUX_RELATION_PREFIX)
to filter delegate fields on an object. TheCompoundUniqueInput
schemas are filtered out correctly.The text was updated successfully, but these errors were encountered: