-
Notifications
You must be signed in to change notification settings - Fork 63
multiple filters with offset paging #378
Description
I have this below hierarchical query where I want to select a particular item. this works
query Incident {
incident(id: 1) {
id
name
code
contactEmail
logoUrl
incidentTypeId
openDate
closeDate
inventoryCount
dapStateId
dapCount
created
updated
enquiries(filter: null, skip: 0, take: null) {
items {
enquirerDaps(filter: "dapId==209", skip: null, take: null) {
items {
id
enquiryId
title
gender
familyName
givenNames
nationalityId
dob
age
religion
medicalConditions
totalRoute
knownClosestRelative
with
dapId
created
updated
}
}
}
}
}
}
This will return every enquiry with no enquirerDap items where it doesn't match the lower filter and the enquirerDaps items populated where it does match (e.g. in this example anything with 209).
Ideally I would like just the enquiry and enquiryDaps where there is an explicit match to dapId==209 so I tried introducing a filter at the enquiry level with the logic of only selecting items where there are result of the lower query.
"enquirerDaps.count()>0"
but I get back this message
{
"errors": [
{
"message": "Method 'count' not found on current context 'OffsetPage`1'"
}
]
}
I also tried creating a field on the enquiry object to say how many enquirerDaps are present however that doesn't seem to take the lower filter into account.
Not 100% sure on best approach here hence trying a number of ways but would really appreciate some guidance on this please.