GraphQL: Return a product's collections & determine if they are manual / custom (with tax override)

Highlighted
Excursionist
37 2 7

I am trying to return the collections to which a given product belongs, and then determine if they are custom / manual or automatic. Is ruleSet equaling null a reliable way to achieve this (like below)? 

My actual end goal is to create a duplicate product and, if it belongs to a collection with a tax override applied, ensure that the new product also belongs to that collection. However, my understanding is the API currently doesn't expose tax overrides, so my current planned workaround is to return a given original product's collections, then loop through and use the Collects REST endpoint to add the duplicate product to all manual collections to ensure the tax override is applied. 

Thank you.

 

 

  {
    product(id: "gid://shopify/Product/5827522134180") {
      collections(first: 5) {
        edges {
          node {
            handle
            id
            ruleSet { rules { column } }
          }
        }
      }
    }
  }

 

 

0 Likes