1
votes

I need to fetch all products using Shopify API by collection id...

I tried:

mutation {
  bulkOperationRunQuery(
    query:"""
    {
      products(query: "tag:women OR collection:172173852808") {
        edges{
      node{
        id
        tags
        
        images {
          edges {
            node {
              id
              originalSrc
            }
          }
        }
        variants(first:10) {
          edges{
            node{
              id
              price
              compareAtPrice
              image{
                originalSrc
              }
              inventoryQuantity
              selectedOptions{
                name
                value
              }
              sku
              title
              weight
              weightUnit  
            }
          }
        }
      }
    }
      }
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

Result Shopify gives me is just product with tags: women and there are no products from collection id 172173852808

How to run a query to get products from one or more specific connections?

1

1 Answers

1
votes

If every product in that collection has the tag woman, just change your query to bulk download the collection and its products. Also, before you go and do a bulk query, verify it works without being a bulk query. That usually exposes the problems with the setup.