GraphQL. Query orders filtered by product tag.

Solved
Highlighted
Tourist
4 0 2

Hi everyone. 
I have the following orders query:

query($cursor: String) {
    orders(
        first: 10, 
        after: $cursor, 
        reverse: true
    ) {
        pageInfo { 
          hasNextPage 
          hasPreviousPage
        }
        edges { 
          cursor
          node {
            id
            createdAt
            name
            email
            phone
            totalPriceSet {
                presentmentMoney {
                    amount
                    currencyCode
                } 
            } 
            shippingAddress {
                address1
                address2
                city
                country
                countryCodeV2
                firstName
                lastName
                phone
                zip
                company
                provinceCode
            }
            shippingLine {
              shippingRateHandle
            }
            lineItems(first: 10) {
              edges {
                node {
                  sku
                  quantity
                  product {
                    id,
                    tags
                    title
                  }
                }
              }
            }
          }
        }
    }
  }

Is it possible to get orders that have a product with a specific tag?

I will be glad for the help.



0 Likes
Highlighted
Shopify Partner
1777 211 370

This is an accepted solution.

It's not possible. You'll have to go through all orders and check lineitems/products.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
Highlighted
Tourist
4 0 2

Thanks.

0 Likes