Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

api

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 78

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.