api

AmanLajpal
Visitor
3 0 2

Hi there,

We are working on a mobile app for Shopify, we are using storefront API (GraphQL). And we are trying to fetch products from different collections, we are successful in fetching data from Normal Collections but are Unable to fetch from the smart collections. Below given is the body that we are trying to fetch.

What we are trying:

AmanLajpal_0-1649177517907.png

Result that we are getting:

AmanLajpal_1-1649177521346.png

 

Reply 1 (1)

lizk
Shopify Staff
246 58 72

Hi,
I think your query is actually correct! This query should be able to return products for both automated and manual collections.

{
  collections(first: 10) {
    edges {
      node {
        title
        products(first: 10) {
          edges {
            node {
              title
            }
          }
        }
      }
    }
  }
}


You should verify that the products in your smart collection are Active.

If your products are in draft status then they will not show up in the result of this query.

To learn more visit the Shopify Help Center or the Community Blog.