Solved

Blank Responses from Storefront API with a specific Private App Access Token

VAutoGroup
Tourist
7 1 1

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?

Accepted Solution (1)

FactoryAidan
Shopify Partner
10 1 9

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.

View solution in original post

Replies 2 (2)

FactoryAidan
Shopify Partner
10 1 9

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.

VAutoGroup
Tourist
7 1 1

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?