First of all, thanks a lot for this extension, which is really crucial in our project as part of a multi-tenant validation.
We ran into an issue related to the usage of the Fluent API of Prisma.
Example schema:
model Parent {
id Int @id @default(autoincrement())
child Child[]
}
model Child {
id Int @id @default(autoincrement())
child String
parent Parent? @relation(fields: [parentId], references: [id])
parentId Int?
}
The problem seems to occur only if a field with the same name as the model is used. The (string) value of the field is then replaced with null (related to this operation).
We solved it simply by changing the field name of the relation to the plural form (childs) in order to have a difference to the field name (child).
First of all, thanks a lot for this extension, which is really crucial in our project as part of a multi-tenant validation.
We ran into an issue related to the usage of the Fluent API of Prisma.
Example schema:
Example relation query:
Expected output:
Actual output:
The problem seems to occur only if a field with the same name as the model is used. The (string) value of the field is then replaced with
null
(related to this operation).We solved it simply by changing the field name of the relation to the plural form (
childs
) in order to have a difference to the field name (child
).