I’m working on a headless ecommerce project using Gatsby with Shopify as the backend. My setup has multiple product collections, and each collection contains various products that I need to display.
The problem I’m facing is that when I try to write GraphQL queries, I can only see allShopifyProducts available in the GraphQL explorer. I don’t see any options to query collections data like allShopifyCollection or similar.
I’ve configured the gatsby-source-shopify plugin correctly with the required parameters - I’m using my Admin API access token for the password field and the correct store URL. The build process completes without any errors, so the connection seems to be working fine.
However, I still can’t access collection queries in my GraphQL schema. Has anyone encountered this issue before? I’ve been trying to solve this for hours but haven’t found a working solution yet. Any help would be greatly appreciated!
sounds like a caching issue. delete your .cache and public folders, then run gatsby develop again. the graphql schema sometimes doesn’t update properly after plugin changes. also, double-check that your shopify collections are actually published - i wasted hours debugging that once lol
The issue’s probably with your Shopify store’s collection availability in the Storefront API. Even with proper Admin API permissions, collections need to be accessible through the Storefront API for gatsby-source-shopify to work. I ran into this exact problem with a client’s store - collections were created but weren’t configured for headless access. Go to your Shopify admin, check each collection, and make sure the ‘Search engine listing preview’ is enabled and the collection’s available to the Online Store sales channel. Without this setup, collections won’t show up in your GraphQL schema no matter how you configure the plugin. Most people miss this step in headless implementations, but it’s crucial for data fetching.
Had this exact issue during a recent migration. Your Shopify API token doesn’t have the right scopes. Even though the plugin connects fine and pulls products, collections need specific read permissions that probably aren’t in your current token. Check your Shopify Admin API settings - make sure your private/custom app has both read_products AND read_content enabled. The read_content scope is what you’re missing - it’s needed for collections but easy to overlook. Update those permissions, then restart your dev server completely. Fixed it for me in minutes.
Check your gatsby-config.js file - make sure the plugin has downloadImages set to true, since this affects how collection data gets fetched. I’ve seen collections disappear from the GraphQL schema when certain fields are missing from the API response. If your plugin version supports it, try adding includeCollections explicitly in your plugin options. Also double-check that your collections actually have products in your Shopify admin. Empty collections won’t generate GraphQL nodes. I ran into this once where collections existed but had zero published products - Gatsby completely skipped them during schema generation.
Begin by verifying your gatsby-source-shopify plugin version, as earlier versions had limited support for collections. I faced a similar issue a while back and found that upgrading to at least version 3.0 resolved it. Also, ensure that your Shopify Admin API permissions allow read access to collections; this often gets overlooked. After updating the plugin, the allShopifyCollection and shopifyCollection queries should be available in your GraphQL explorer. If they still do not appear, try running gatsby clean followed by a rebuild to ensure that the collection nodes are accessible for filtering and sorting in GraphQL.