We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
model User { id Int @id @default(autoincrement()) username String @unique employedBy CompanyUser[] properties PropertyUser[] companies Company[] @@allow('all', true) } model Company { id Int @id @default(autoincrement()) name String companyUsers CompanyUser[] propertyUsers User[] properties Property[] @@allow('all', true) } model CompanyUser { company Company @relation(fields: [companyId], references: [id]) companyId Int user User @relation(fields: [userId], references: [id]) userId Int dummyField String @@id([companyId, userId]) @@allow('all', true) } enum PropertyUserRoleType { Owner Administrator } model PropertyUserRole { id Int @id @default(autoincrement()) type PropertyUserRoleType user PropertyUser @relation(fields: [userId], references: [id]) userId Int @@allow('all', true) } model PropertyUser { id Int @id @default(autoincrement()) dummyField String property Property @relation(fields: [propertyId], references: [id]) propertyId Int user User @relation(fields: [userId], references: [id]) userId Int roles PropertyUserRole[] @@unique([propertyId, userId]) @@allow('all', true) } model Property { id Int @id @default(autoincrement()) name String users PropertyUser[] company Company @relation(fields: [companyId], references: [id]) companyId Int @@allow('all', true) }
await db.user.create({ data: { username: 'test@example.com', }, }); await db.company.create({ data: { name: 'My Company', companyUsers: { create: { dummyField: '', user: { connect: { id: 1, }, }, }, }, propertyUsers: { connect: { id: 1, }, }, properties: { create: [ { name: 'Test', }, ], }, }, }); await db.property.update({ data: { users: { create: { dummyField: '', roles: { createMany: { data: { type: 'Owner', }, }, }, user: { connect: { id: 1, }, }, }, }, }, where: { id: 1, }, });
"Error calling enhanced Prisma method `update`: ", "Invalid `db[model].create()` invocation in", "node_modules\\@zenstackhq\\runtime\\enhancements\\policy\\handler.js:328:44", "", " 325 if (this.shouldLogQuery) {", " 326 this.logger.info(`[policy] \\`create\\` ${model}: ${(0, utils_1.formatObject)(createArgs)}`);", " 327 }", "→ 328 const result = yield db[model].create({", " data: {", " dummyField: \"\",", " user: {", " connect: {", " id: 1", " }", " },", " roles: {", " createMany: {", " data: [", " {", " type: \"Owner\"", " }", " ]", " }", " },", " propertyId: 1,", " + property: {", " + create: PropertyCreateWithoutUsersInput | PropertyUncheckedCreateWithoutUsersInput,", " + connectOrCreate: PropertyCreateOrConnectWithoutUsersInput,", " + connect: PropertyWhereUniqueInput", " + }", " },", " select: {", " id: true,", " roles: {", " select: {", " id: true", " }", " }", " }", " })", "", "Argument `property` is missing.", " at Object.updateOneProperty
https://github.com/f8k8/ZenstackBugTests/tree/connect_bug
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Schema
Code
Error
Repro
https://github.com/f8k8/ZenstackBugTests/tree/connect_bug
The text was updated successfully, but these errors were encountered: