How to get products by products tags?

Highlighted
New Member
1 0 0

I need get products by multiple tags. I tried this:

$query = '
      query ($query: String) {
        products(first: 100, query: $query) {
          edges {
            node {
              id
              title
              tags
            }
          }
        }
      }
    ';

    $variables = [
      'query' => "tag:Oakland Raiders OR tag:baseball OR tag:Baseball"
    ];

But this returns products only that has all specified tags. But my expectation is to get products that has one of specified tags at least.

0 Likes