Sagex3 - graphql query with a list filter

SUGGESTED

We have the need to query a list of products using the new GraphQL API. The filter in specific is a list of product IDs. We already took the graphql training and this is not addressed anywhere. Could you please help? This is the query that we are trying to build 

{

  xtremX3MasterData {

    product {

      query(filter: "{_id in('ALUM_RACK','xyz','abc')}") {

        edges {

          node {

            _id

            code

          }

        }

      }

    }

  }

}

  • 0
    SUGGESTED

    Hi 
    EDIT2:
    I've tested more, please see below what works and what doesn't:

    What works:

    1 - make a list of several filters

    {
      productList:xtremX3MasterData {
        product {
          product01:query(filter: "{_id: 'ALUM_RACK'}") {
            totalCount
            edges{
              node{
                description1
              }
            }
          }
          product02:query(filter: "{_id: 'ALUMSHEET'}") {
            totalCount
            edges{
              node{
                description1
              }
            }
          }
        }
      }
    }

    2- Use _in operator for listing:

     productList:xtremX3MasterData {
        product {
          product01:query(filter: "{_id: {_in: ['ALUM_RACK','ALUMSHEET']}}") {
            totalCount
            edges{
              node{
                description1
              }
            }
          }

    What doesn't work:

    - _regex with multiple values, although it works with a single value.