Is it possible to query articles from a customer account extension?
I’m getting Access denied for article field. Required access: 'unauthenticated_read_content' access scope.
I have this scope included in the app, triple-checked.
Also the extension configuration includes api_access = true
and network_access = true
const { query } = useApi();
//...
const articles = await query(
`query {
nodes(ids: ["ARTICLE_GID"]) {
... on Article {
id
title
}
}
}`,
);
Try some of these Get customer email - #6 by kyle_liu. Re-installation of app is what got me
thanks for the suggestion @devin , yes I have deployed and re-installed several times, making sure that the scope is mentioned in the instalation screen.
Also if I use the graphQL instance from the shopify app dev
to run this quey
query {
currentAppInstallation {
accessScopes {
description
handle
}
}
}
I get the exact scopes I have access, including unauthenticated_read_content
Hey,
the storefront api tokens for extensions aren’t determined by your app and are the same for everyone.
You can find a full list of supported scopes in the docs
unauthenticated_read_content
is currently not among them.
We will look into it, but I can neither promise that it will be added nor provide a timeline at this moment.
hey @Robin-Shopify thanks for answering!!
ok got it! (the error message totally misled me)