P
Prisma4mo ago
keii

Cannot select both '$scalars: true' and a specific scalar field 'tags'.

This is my relevant schema
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")
}
and this is my query
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,
},
});
how would i fix this error?
Cannot select both '$scalars: true' and a specific scalar field 'tags'.
Cannot select both '$scalars: true' and a specific scalar field 'tags'.
I've checked relevant github issues and seems like this error is common and vague
1 Reply
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View