AEM 6.5 GraphQL query with filter variable of type String Array | Community
Skip to main content
Level 3
February 10, 2023
Solved

AEM 6.5 GraphQL query with filter variable of type String Array

  • February 10, 2023
  • 1 reply
  • 3083 views

Hi,

 

For the below query, I want to pass the filter variable for name. Can anyone suggest if used such type of query in the AEM? I really appreciate any help you can provide.

 

query { personList(filter: { name: { _logOp: OR _expressions: [ { value: "Ramesh" }, { value: "Smith" } ] } }) { items { name firstName } } }

  

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by krishna_sai

Hi @mukeshaem , Can you please try something like below


Hope this helps
Thanks,

Krishna

1 reply

krishna_sai
Community Advisor
krishna_saiCommunity AdvisorAccepted solution
Community Advisor
February 10, 2023

Hi @mukeshaem , Can you please try something like below


Hope this helps
Thanks,

Krishna

MukeshAEMAuthor
Level 3
February 10, 2023

Thanks, @krishna_sai for your quick response. The only problem with this approach is I need to change the query to increase filter parameters. Wondering if it's possible to pass an array of strings as a filter parameter instead of 2 separate parameters parameter1 and parameter2. 

krishna_sai
Community Advisor
Community Advisor
February 10, 2023

Hi @mukeshaem , I don't think it is possible here name is single valued. If the filtering parameter is multivalued like tags etc. you can follow something like this mentioned in below https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/graphql-array/td-p/425661

Thanks,

Krishna