-
-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Labels
Milestone
Description
Zenstack version 2.8.0 changed the type signature for nested creates/connects on delegates, incorrectly requiring referenced identifiers.
With the following schema:
model A {
id Int @id @default(autoincrement())
b B[]
}
model B {
id Int @id @default(autoincrement())
a A @relation(fields: [aId], references: [id])
aId Int
type String
@@delegate(type)
}
model C extends B {
f String?
}
I expect to be able to call something like:
db.c.create({ data: { a: { connect: { id: 0 } } } });
But as of version 2.8.0, Zenstack defines the data signature (in the generated .logical-prisma-client/runtime/index-fixed.d.ts) as the following (requiring the aId reference property):
export type CCreateInput = {
aId: number
f?: string | null
a: ACreateNestedOneWithoutDelegate_aux_A_b_CInput
};
In previous versions, Zenstack defined it as expected:
export type CCreateInput = {
f?: string | null
a: ACreateNestedOneWithoutDelegate_aux_A_b_CInput
};
Environment:
- ZenStack version: >= 2.8.0
- Prisma version: any
- Database type: any
ymc9