Access denied for products field with unauthenticated_read_product_listings scope

Hello,

My session has unauthenticated_read_product_listings scope and when I run the graphql query below:

const client = new Shopify.Clients.Graphql(session.shop, session.accessToken);
 await client.query({
                            data: `{
                                    products (first: 10) {
                                      edges {
                                        node {
                                          id
                                          title
                                        }
                                      }
                                    }
                                  }`,
                           });

It always throws ‘Access denied for products field’ errors. Can anyone advise me on what I’m doing wrong? Thank you

1 Like

Hi @jborden13 :waving_hand:

A Storefront API access token with the unauthenticated_read_product_listings scope should definitely have permissions to query products via the Storefront API. As noted in this doc from the [shopify-api-node](https://github.com/Shopify/shopify-api-node) repo, the storefront client can be queried with Shopify.Clients.Storefront()whereas your snippet appears to be referencing Shopify.Clients.Graphql()

Testing your query using CURL or a client like Postman/Insomnia may be helpful to to rule out any issues with the Node library as well. The request should:

If the issue persists, please let us know via the support page of your partner dashboard so that we can take a closer look with your authenticated permissions.

Hope that helps!