A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I got this error to fetch orders with '@shopify/koa-shopify-auth'from a PUBLIC app.
Uncaught (in promise) Error: GraphQL error: Access denied for orders field.
The query is like this.
orders(first: 10, after: $cursor, query: $query, reverse: true) {
edges {
cursor
node {
currentTotalPriceSet {
presentmentMoney {
amount
currencyCode
}
}
tags
}
}
pageInfo {
hasNextPage
}
}
with $query like this
let query = campaigns
.map((campaign) => `tag:'FreeGiftCampaignId: ${campaign.id}'`)
.join(" OR ");
I added reverse: true, and the scopes are correctly set
SCPOPES: read_orders,read_all_orders,write_orders,read_products,read_discounts,write_discounts,write_script_tags
Also the app has been approved for read_all_orders
The strange thing about this issue is that it's not happening to every merchant only some of them have this issue
if i query the scopes for a failing merchant (just before the failing call) i got this which seems totaly fine
[
{
"handle": "read_all_orders"
},
{
"handle": "write_orders",
},
{
"handle": "read_products",
},
{
"handle": "write_discounts",
},
{
"handle": "write_script_tags",
},
{
"handle": "read_orders",
},
{
"handle": "read_discounts",
},
{
"handle": "read_script_tags",
}
]
also the 2 preceding calls which get a product and a collection fails with thoses errors
message: "Product access denied"
message: "Collection access denied"
So it definitely seems like a scope issue.
but what i am not getting is: