Cannot select both '$scalars: true' and a specific scalar field 'tags'.
This is my relevant schema
and this is my query
how would i fix this error?
I've checked relevant github issues and seems like this error is common and vague
model EventTag {
id Int @id @default(autoincrement()) @db.UnsignedInt
eventUserId Int @db.UnsignedInt
targetId Int @db.UnsignedInt
timestamp DateTime @default(now()) @db.DateTime(0)
target User @relation("event_tags_target_idTousers", fields: [targetId], references: [id], onUpdate: Restrict, map: "event_tags_target_id_foreign")
eventUser EventUser @relation(fields: [eventUserId], references: [id])
@@index([targetId], map: "event_tags_target_id_foreign")
}
model EventUser {
id Int @id @default(autoincrement()) @db.UnsignedInt
userId Int @db.UnsignedInt
eventId Int @db.UnsignedInt
isAlive Boolean @default(true)
secret String @db.VarChar(255)
targetId Int @db.UnsignedInt
event Event @relation(fields: [eventId], references: [id], onUpdate: Restrict, map: "event_users_event_id_foreign")
target User @relation("event_users_target_idTousers", fields: [targetId], references: [id], onUpdate: Restrict, map: "event_users_target_id_foreign")
user User @relation("event_users_user_idTousers", fields: [userId], references: [id], onUpdate: Restrict, map: "event_users_user_id_foreign")
tags EventTag[]
@@index([eventId], map: "event_users_event_id_foreign")
@@index([targetId], map: "event_users_target_id_foreign")
@@index([userId], map: "event_users_user_id_foreign")
}
model EventTag {
id Int @id @default(autoincrement()) @db.UnsignedInt
eventUserId Int @db.UnsignedInt
targetId Int @db.UnsignedInt
timestamp DateTime @default(now()) @db.DateTime(0)
target User @relation("event_tags_target_idTousers", fields: [targetId], references: [id], onUpdate: Restrict, map: "event_tags_target_id_foreign")
eventUser EventUser @relation(fields: [eventUserId], references: [id])
@@index([targetId], map: "event_tags_target_id_foreign")
}
model EventUser {
id Int @id @default(autoincrement()) @db.UnsignedInt
userId Int @db.UnsignedInt
eventId Int @db.UnsignedInt
isAlive Boolean @default(true)
secret String @db.VarChar(255)
targetId Int @db.UnsignedInt
event Event @relation(fields: [eventId], references: [id], onUpdate: Restrict, map: "event_users_event_id_foreign")
target User @relation("event_users_target_idTousers", fields: [targetId], references: [id], onUpdate: Restrict, map: "event_users_target_id_foreign")
user User @relation("event_users_user_idTousers", fields: [userId], references: [id], onUpdate: Restrict, map: "event_users_user_id_foreign")
tags EventTag[]
@@index([eventId], map: "event_users_event_id_foreign")
@@index([targetId], map: "event_users_target_id_foreign")
@@index([userId], map: "event_users_user_id_foreign")
}
return await prisma.eventUser.findMany({
where: {
eventId: event.id,
},
include: {
user: true,
tags: true,
},
});
return await prisma.eventUser.findMany({
where: {
eventId: event.id,
},
include: {
user: true,
tags: true,
},
});
Cannot select both '$scalars: true' and a specific scalar field 'tags'.
Cannot select both '$scalars: true' and a specific scalar field 'tags'.
1 Reply
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View