Headless commerce and custom storefronts with Shopify APIs and SDKs
I started development of a Custom Storefront yesterday. I issued an Storefront access token for an existing Private App (Backend was already coded).
This query worked yesterday with the Access Token - Then i finished for the day came in this morning and resumed development.
{
products(first: 25) {
edges {
node {
id
}
}
}
}
Instead of returning the first 25 Products as expected, it is returning an empty array
{"data":{"products":{"edges":[]}}}
It does the same thing in both Postman and the Official JS Shop SDK
After troubleshooting for over an hour, checking documentation, etc. I decided to swap out the Access Token for a freshly generated one as a last ditch attempt to get it to work before posting the issue.
Using the new access token with the same privileges on the same dev store with the query worked and returns the expected results.
I have verified this occurs across multiple API Versions and I am getting status codes of 200 every time. Just empty contents. Also if i query an individual product I was also getting a null value returned.
I think this is a bug, a cache invalidation issue or something on shopify's side but I just want to verify that this isn't normal and I don't need to do something differently, as well as bring it to the attention of Shopify.
Anyone else experience this issue?
Solved! Go to the solution
This is an accepted solution.
Every Private App that has a Storefront API Access Token attached will show as a separate Sales Channel to associate your Products to. It sounds like your existing Products aren't updated to be published to the Private App associated with the Storefront API Access Token you're using. You can manage Product Sales Channel Publications in Shopify's browser-based Admin in the Bulk Editor or on individual Products.
This is an accepted solution.
Every Private App that has a Storefront API Access Token attached will show as a separate Sales Channel to associate your Products to. It sounds like your existing Products aren't updated to be published to the Private App associated with the Storefront API Access Token you're using. You can manage Product Sales Channel Publications in Shopify's browser-based Admin in the Bulk Editor or on individual Products.
This does seem to be the case. I am publishing products via Admin REST API and
'published_scope' => 'global'
seems to not publish items to the Storefront API
Any ideas?
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023