Shopify / storefront-api-examples

Example custom storefront applications built on Shopify's Storefront API
https://help.shopify.com/api/storefront-api
MIT License
1.12k stars 329 forks source link

Shopify Storefront API returning an empty products array #134

Closed derhallim closed 3 years ago

derhallim commented 3 years ago

I am very new to Shopify. I generate a storefront access token, and checked all storefront api permissions. I am using the reactjs project, I added my store info along with the access token in index.js.. I run my code, it doesn't generate any error in the console, however am getting an empty array for products. If I try to set a random token, it will in fact generate an error so I know it's working and communicating with Shopify successfully.

I made sure the products in my store are active. Is there any other step I need to validate?

swalkinshaw commented 3 years ago

Storefront API is always scoped to the channel you authenticated with; so for products to be visible they need to be published to that channel/app. Maybe verify that?

derhallim commented 3 years ago

That was it..! Thanks @swalkinshaw