tmoney
08/08/2019, 5:37 PMnull
. I want it to return a list of nodes where
the relationship is null
. This worked fine in graphcool, but now it doesn’t seem to be the way that you need to do it in Prisma.
Here’s my query:
query getCompanyAndFees($companyId: ID!) {
Company: company(
where: {
id: $companyId
}
) {
id
fees(
where: {
isEnrollmentFee: true
tuitionServiceFeeForCompany: null
},
orderBy: name_ASC
) {
id
name
tuitionServiceFeeForCompany {
id
}
}
}
}
This query gives me back the following payload:
{
"data": {
"Company": {
"id": "cjac65ek0127b0",
"fees": []
}
}
}
If I comment out this condition in the where clause: tuitionServiceFeeForCompany: null
You can see I get back several fees where tuitionServiceFeeForCompany
is null
{
"data": {
"Company": {
"id": "cjac65ek0127b0",
"fees": [
{
"id": "cjaz34ym31hdi0,
"name": "53 Books",
"tuitionServiceFeeForCompany": null
},
{
"id": "cjaz37nm71he7",
"name": "CD & Flash Cards",
"tuitionServiceFeeForCompany": null
}
]
}
}
}
It should be getting back that last result without commenting out the tuitionServiceFeeForCompany: null
tmoney
08/08/2019, 6:53 PM1.31
syntax of using an INLINE
relation. When I switch it back to TABLE
it returns the expected data. @Harshit would this be considered a bug or expected behavior?Harshit
08/08/2019, 7:14 PMtmoney
08/08/2019, 7:15 PMtmoney
08/08/2019, 7:15 PMHarshit
08/09/2019, 2:46 AMTy Holbrook
08/09/2019, 1:21 PMfees
with no tuitionServiceFeeForCompany
and there is one fee
with a tuitionServiceFeeForCompany
defined.
It's not filtering the ones that don't have the relation defined, it's just not returning any data at all.Harshit
08/09/2019, 1:41 PMTy Holbrook
08/09/2019, 3:54 PMtmoney
08/09/2019, 3:56 PMHarshit
08/09/2019, 3:57 PMTy Holbrook
08/09/2019, 3:57 PMHarshit
08/09/2019, 4:00 PMTy Holbrook
08/09/2019, 4:06 PM