What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

GraphQL. Query orders filtered by product tag.

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.