const graphqlClient = new shopify.api.clients.Graphql({ session });
try {
const data = await graphqlClient.query({
data: query { shopLocales { locale primary published } },
});
console.log(data?.body?.data);
} catch (error) {
console.log(error);
}
I’m getting “GraphqlQueryError: GraphQL query returned errors” while using the above code , Any solution for fix?
read_locales scope was not given
Hi!
The error likely stems from missing API permissions, so ensure your app has access to shopLocales. Double-check your query structure against Shopify’s GraphQL schema to ensure it’s correct. Use Shopify’s GraphiQL app to test the query and identify specific issues. Also, review the full error message for hints and ensure your Shopify API library is up to date. Let me know if this helps!