PinkiePie
04/12/2022, 5:56 PMconst res = await prisma.m.findFirst({
where: {
a: {
b: {
c: 'd'
}
}
},
});
where my schema looks like
enum C {
a
b
c
d
}
type B {
c C
otherField String
}
type A {
b B
otherField String
}
model M {
id String @id @default(auto()) @map("_id") @db.ObjectId
a A
otherField String
}
It fails both on TS level and runtime. it feels like it's mandatory to specify the values of otherField
as well, but that makes no sense 😞PinkiePie
04/12/2022, 6:13 PMotherField
included, it starts to work. as for me, that sounds like a serious bug 😄 mandatory fields should be mandatory only for create
operation, but not for findFirst
janpio
janpio
PinkiePie
04/20/2022, 8:17 PM