Issue
- If you need to filter by status and execute this query:
query{
c {
countrieses (filter:"status eq pending"){
items {
status
id
selected
}
}
}
}
{
"errors": [
{
"message": "Exception while fetching data (/c/countrieses) : A property used in the filter criteria is not supported: status eq pending",
"locations": [],
"extensions": {
"exception": {
"errno": 500
},
"code": "Internal Server Error",
"classification": "DataFetchingException"
}
}
],
"data": {
"c": {
"countrieses": null
}
}
}
Resolution
- The status field is set as a collection and is managed as integer.
- You need to pass a lambda expression:
(status/any(x:(x eq [statusValue])))
- The following query is an example for filtering by pending status
query{
c {
countrieses (filter:"(status/any(x:(x eq 1)))"){
items {
status
id
selected
}
}
}
}