Solved

GraphQL. Query orders filtered by product tag.

kushniruk
Shopify Partner
5 0 7

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.



Accepted Solution (1)

Visely-Team
Shopify Partner
1843 210 488

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

View solution in original post

Replies 2 (2)

Visely-Team
Shopify Partner
1843 210 488

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
kushniruk
Shopify Partner
5 0 7

Thanks.