I want to implement atleast one filter provided by AEM on an array field to filter the categories which contains atleast one of the values:
_expressions: [
{
_apply: AT_LEAST_ONCE,
values: [
"health",
"fitness"
]
}
]
Now when I run the query, I get the following error:
{
"errors": [
{
"message": "Exception while fetching data (/output) : Cannot compare single value to an array.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"output"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": null
}
Can someone help me debugging why this error shows up and how can I avoid it?
Solved! Go to Solution.
Views
Replies
Total Likes
Can you try the similar to below example given in https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...
This will filter all persons
for any that have the name Jobs
or Smith
.
Sample Query
query {
personList(filter: {
name: {
_logOp: OR
_expressions: [
{
value: "Jobs"
},
{
value: "Smith"
}
]
}
}) {
items {
name
firstName
}
}
}
Sample Results
{
"data": {
"personList": {
"items": [
{
"name": "Smith",
"firstName": "Adam"
},
{
"name": "Smith",
"firstName": "Joe"
},
{
"name": "Jobs",
"firstName": "Steve"
}
]
}
}
}
Views
Replies
Total Likes
Can you try the similar to below example given in https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...
This will filter all persons
for any that have the name Jobs
or Smith
.
Sample Query
query {
personList(filter: {
name: {
_logOp: OR
_expressions: [
{
value: "Jobs"
},
{
value: "Smith"
}
]
}
}) {
items {
name
firstName
}
}
}
Sample Results
{
"data": {
"personList": {
"items": [
{
"name": "Smith",
"firstName": "Adam"
},
{
"name": "Smith",
"firstName": "Joe"
},
{
"name": "Jobs",
"firstName": "Steve"
}
]
}
}
}
Views
Replies
Total Likes