Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

AEM 6.5 GraphQL query with filter variable of type String Array

Avatar

Level 3

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
    }
  }
}

  

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi @MukeshAEM , Can you please try something like below

krishna_sai_0-1676027908960.png


Hope this helps
Thanks,

Krishna

View solution in original post

3 Replies

Avatar

Correct answer by
Level 5

Hi @MukeshAEM , Can you please try something like below

krishna_sai_0-1676027908960.png


Hope this helps
Thanks,

Krishna

Avatar

Level 3

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. 

Avatar

Level 5

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