[Storefront] Unable to query Products & Collections

Experiencing a very recent issue where the storefront API is no longer returning data as expected.

This has occurred since about 11th of April 2025.

Extremely troublesome as I am unable to find any documented change to the Storefront API for products/collections.

Examples below outline that the access token has the appropriate scopes granted, but the response is as if we’re blocked from reading collections.
Docs clearly state that only “unauthenticated_read_product_listings” is required.

Does anyone have insight into why this would be happening all of a sudden?

Request IDS:
139eeb1a-a6a0-495b-b0b2-27ff0922c5bd-1744784309
972bf06c-59bb-4224-acdb-a9317be9234c-1744784313
da945abc-3910-4e10-b3bf-8233c81b8e5e-1744784352
085b887d-1f9b-4d6a-9ccf-03adc6b79394-1744784396


Using 2025-01

Here is the response when creating a token, these scopes all match the scopes I’ve outlined in our app.toml file.

{
  storefrontAccessTokenCreate: {
    userErrors: [],
    shop: { id: 'gid://shopify/Shop/XXXXX' },
    storefrontAccessToken: {
      accessScopes: [
        { handle: 'unauthenticated_read_metaobjects' },
        { handle: 'unauthenticated_read_product_tags' },
        { handle: 'unauthenticated_read_product_inventory' },
        { handle: 'unauthenticated_read_product_listings' },
        { handle: 'unauthenticated_write_checkouts' },
        { handle: 'unauthenticated_read_checkouts' },
        { handle: 'unauthenticated_write_customers' },
        { handle: 'unauthenticated_read_customers' },
        { handle: 'unauthenticated_read_selling_plans' },
        { handle: 'unauthenticated_read_product_pickup_locations' }
      ],
      accessToken: 'XXXXX',
      title: 'SF Token'
    }
  }
}

And I simple collection query like this:

{
    collections(first: 10, reverse: true) {
        totalCount
    }
    shop {
        name
    }
}

Is now returning

{
    "data": {
        "collections": {
            "totalCount": "0"
        },
        "shop": {
            "name": "GN - Dev & Partner"
        }
    }
}

But a token from my testing app returns

{
    "data": {
        "collections": {
            "totalCount": "4"
        },
        "shop": {
            "name": "GN - Dev & Partner"
        }
    }
}
1 Like

Hey @callummcmaugh

The most likely reason you’re seeing a totalCount of 0 for collections is because they may not be published to your sales channel; especially considering you have all the right access scopes.

You can verify and adjust this in your Shopify admin under the collection’s availability settings: https://help.shopify.com/en/manual/products/collections/make-collections-available?utf8=â#adjusting-the-availability

If you need to programmatically publish collections to your app’s sales channel, you can use the publishablePublish mutation via the Admin API. There’s an example in our docs showing exactly how to do this with a collection: publishablePublish - GraphQL Admin

Let me know if that works.

Hey @KyleG-Shopify

My app is not a sales channel and uses the Storefront API via a public access token for each merchant. I thought a channel wasn’t required, see this post.

I’ve been ensuring collections/products are published to Online Store and would appear as expected prior to this issue.
Your solution makes sense, but doesn’t explain why it would stop working suddenly unless a policy changed from Shopify

@KyleG-Shopify

I’ve dived into this today. While I’m confused on why this change seemed sudden, I have been able to find an unpublished publishable ID for the collection I’m trying to serve through Storefront.

I’ve requested API access to “write_publications” from the Shopify app team but I’m waiting on that. I tried to publish it with the endpoint you provided, through Shopify Graphiql App, but it’s saying “Publication does not exist or is not publishable”. The Publication exists so I’m unsure why it’s not publishable. I assume it’s because the app it belongs to needs to publish it.

Do you have any insight into why my app was forced into a publication modal, or why I can’t publish it?

Thanks.

Hey @callummcmaugh,

Thanks for sharing that. You’re right, your app doesn’t have to be configured as a sales channel to use the storefront API. The products/collections should still be required to be published to your app to be able to query them through your access token.

I’ve looked through our changelog as well and I don’t see any recent changes to collection publications. The issue you’re seeing in the graphiql app does seem permission related. I’d recommend using your app directly (once the scopes are approved), or manually adjusting this in the admin collection settings to confirm it will work.

That still doesn’t address why this was working previously and is no longer working. You noticed this starting around April 11th. Has anything changed with how the collections themselves are being created since then? My initial thought here is that by default when you create a collection in the admin, all publications are selected. If they were created using the API, then the publications need to be specified.

I just tested here, and creating a collection on REST will publish to the online store only and on graphql will not publish to any channels unless specified.

If nothing has changed on your end, I’ll check further to see if anything has changed with the default publications on our end.

Hey @KyleG-Shopify, The issue is still occuring on my end.

I’ve been trying to manually re-publish collections to my app (outlined below) but I keep getting an error ‘Publication does not exist or is not publishable’. I’ve updated my app scopes with “write_publications” which has allowed me to read and write publications. However, It seems that my app can’t be published to.

I also can’t dont this through the admin. If I go to collections > manage sales channel, my app doesn’t appear as an option here. I think this is because I never converted to a sales channel.

Is it possible an unintended update made it so non-sales channel apps are now conflicting with Storefront API?

Yes since April 11 this issue popped up without any direct changes to our app. We’ve updated our Checkout UI extension but I don’t see how that would affect our API access.

Find unpublished items for the input collection

   query {
      collection(id: "gid://shopify/Collection/${id}") {
        unpublishedPublications(first: 10) {
          edges {
            node {
              id
              name
              app {
                id
                title
              }
            }
          }
        }
      }
    }

Response containing the Publication gid

Response data {
  collection: {
    unpublishedPublications: {
      edges: [
        {
          node: {
            id: 'gid://shopify/Publication/XXXXX',
            name: 'My app',
            app: {
              id: 'gid://shopify/App/YYYYY',
              title: 'My app'
            }
          }
        }
      ]
    }
  }
}

But when I try to publish this collection & publication ID

Response data {
  publishablePublish: {
    publishable: {
      availablePublicationsCount: { count: 4 },
      resourcePublicationsCount: { count: 4 }
    },
    shop: { publicationCount: 3 },
    userErrors: [
      {
        field: [ 'input', '0', 'publicationId' ],
        message: 'Publication does not exist or is not publishable'
      }
    ]
  }
}

@KyleG-Shopify

Some minor progress.

I’ve written a script to pull the Publication ID for my App based on the collection. “publishPublishable” isn’t working, but “publishPublishableChannel” is. So I’m trying to loop over all products inside too and publish them this way too. It’s hit and miss but I’m making progress.

Odd part is if I query from app > publication. It says my app has nothing to publish to, but If I query collection > unpublished I can see my app publication.

Really seems like some wires have been crossed somewhere.