Expand my Community achievements bar.

SOLVED

AEM 6.5.12 | Persistent query issue with StringFilterExpression parameter

Avatar

Level 4

I'm facing an issue with one of the persistent queries which are using the variable of the type StringFilterExpression. Corresponding post query works fine. Wondering if someone faced such an issue before and suggest if we're doing something wrong.

Persistent query: http://localhost:4502/graphql/execute.json/public-aem-common%2FIncentives1%3Bvariables%3D%7B%22incen....

 

AEM log shows the error message:

Error: 

14.02.2023 16:40:50.677 *WARN* [10.124.240.111 [1676392850656] GET /graphql/execute.json/public-aem-common%2FIncentives1%3Bvariables%3D%7B%22incentiveID%22%3A%5B%7B%22value%22%3A%22RI53%22%7D%2C%7B%22value%22%3A%22RI54%22%7D%5D%7D HTTP/1.1] com.adobe.aem.graphql.impl.servlet.PersistedQueryServlet Cannot recognize GraphQL query type: {"errors":[{"message":"Variable 'incentiveID' has coerced Null value for NonNull type '[StringFilterExpression]!'","locations":[{"line":1,"column":24}],"extensions":{"classification":"ValidationError"}}]}

We do see the same error message in Author and Publisher instances. The corresponding post query works fine and returns the result.

We have seen the community question https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/passing-params-to-persiste... referring a similar issue but the fix suggested there to pass the parameter after UTF-8 encoding, isn't working for us.

Post query:

 

query incentiveList($incentiveID:[StringFilterExpression]!,$locale: String){incentiveList(filter:{
  incentiveID :{
  _logOp: OR   
  _expressions: $incentiveID    
 }},  
_locale : $locale
)
{items{_path,
  incentiveID,
  description{html,markdown,plaintext}
 }  
}}

Graphql Variables:

{"incentiveID": [{"value": "RI53"},{"value":"RI54"}]}

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

To share with the community, we talked to the AEM support team and found that it was an issue with 6.5.12 which is fixed in the latest version but instead of StringFilterExpression, we need to use StringFilter. Query will look like:

query incentiveList($expression:StringFilter!)
{incentiveList(
filter:{incentiveID : $expression}  
)
{items{_path,
  incentiveID,
  description{html,markdown,plaintext}
 }  
}}



View solution in original post

2 Replies

Avatar

Correct answer by
Level 4

To share with the community, we talked to the AEM support team and found that it was an issue with 6.5.12 which is fixed in the latest version but instead of StringFilterExpression, we need to use StringFilter. Query will look like:

query incentiveList($expression:StringFilter!)
{incentiveList(
filter:{incentiveID : $expression}  
)
{items{_path,
  incentiveID,
  description{html,markdown,plaintext}
 }  
}}



Avatar

Level 1

Hi Mukesh,

 

I tried similar query. It’s working on AEM Graphiql console, But when either I am trying to call it from Browser with encoded parameters or through Postman (Graphql variables) then I’m getting error as -

Variable expression has an invalid value. Variable ‘expression’ has corced Null value for NonNull type ‘StringFilter!’