-
-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Milestone
Description
createMany and createManyAndReturn misses relation attributes, although they can be used.
An example,
If I have the following schema:
model House {
id Int @id @default(autoincrement())
doorTypeId Int
door Door @relation(fields: [doorTypeId], references: [id])
windows Window[]
type String
@@delegate(type)
}
model PrivateHouse extends House {
card Int
}
model Skyscraper extends House {
ticket Int
}
model Door {
id Int @id @default(autoincrement())
color String
houses House[]
type String
@@delegate(type)
}
model IronDoor extends Door {
strength Int
}
model WoodenDoor extends Door {
texture String
}
model Window {
id Int @id @default(autoincrement())
houses House[]
}
And let's say I try to add a new houses using the createMany or createManyAndReturn api, see what options it gives me:

^ No windows option, even though it is possible to make multiple connect, as i mentioned if i ignore this typing error it still works, it's just the typing that is messed up.
Another example, if I want to connect a door:

I can only use doorTypeId, but from some reason it's not showing me the option to do that as safely by:
data: {
door: {
connect: id
}
}
Versions:
"devDependencies": {
"prisma": "^5.19.1",
"typescript": "^5.6.2",
"zenstack": "2.5.1"
},
"dependencies": {
"@prisma/client": "^5.19.1",
"@zenstackhq/runtime": "2.5.1"
}
}
svetch
Metadata
Metadata
Assignees
Labels
No labels