gatsbyjs/gatsby-source-shopify

What is the best way to pull the respective products of Shopify Collections?

Closed this issue · 3 comments

In the previous Shopify plugin, the products of a collection were available on allShopifyCollection. In the new plugin, products are not available on collection nodes, so what's the best way to pull those products on that collection page?

Thanks for reporting! I'm showing that a collection's products are available with this query

query MyQuery {
  allShopifyCollection {
    edges {
      node {
        products {
          handle
        }
      }
    }
  }
}

Can you confirm whether this query works for you?

image

One thing to note is that you need to specify this in your gatsby-config plugin options. See the shopifyConnections plugin option - https://github.com/gatsbyjs/gatsby-source-shopify-experimental#plugin-options

@sslotsky Thanks for the quick response. It didn't work on an existing store I had built, but when I tried it on a fresh install of gatsby v3 with the same shopify config, the products attribute was available.