Hi @indrajithpa1 ,
The error you’re facing:
Variable 'expression' has coerced Null value for NonNull type 'IDFilter!'
means that the shape of your expression variable doesn’t match what the IDFilter! type expects. This is very common when calling GraphQL from Postman or other HTTP clients outside the AEM GraphiQL UI.
Based on your query and error, here’s the corrected format you should use for your GraphQL Variables in Postman: GraphQL Query
query ($expression: IDFilter!) {
internetList(filter: {
_path: $expression
}) {
items {
_path
}
}
}
Or, if you're trying to apply multiple OR filters, then that likely uses a LogicalExpression wrapper. But only if the schema supports it!
What You Must Check
Open your AEM GraphQL schema in the GraphiQL tool.
Check if the input for _path uses:
IDFilter! (single object), or
LogicalExpression! (for _logOp and _expressions).
If Schema Supports OR Filter with LogicalExpression
Then your query must change to:
Query:
query ($expression: LogicalExpression!) {
internetList(filter: {
_path: $expression
}) {
items {
_path
}
}
}
Variables:
{
"expression": {
"_logOp": "OR",
"_expressions": [
{
"_operator": "EQUALS",
"value": "/content/dam/sample/content-fragments/internet/internet1"
},
{
"_operator": "EQUALS",
"value": "/content/dam/sample/content-fragments/internet/internet2"
}
]
}
}
Note: Use LogicalExpression! as the variable type if _logOp is being used. IDFilter! cannot accept a LogicalExpression structure — that’s why you're getting the coercion error.
Regards,
Amit