A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I'm trying to get a customer's orders filtered by status=any. I know the customer has orders for sure, the results are always empty []. I've tried both Admin API and GraphQL.'
What am I missing??
Admin API:
https://${shop}/admin/api/2022-01/orders.json?query=customer_id:${id}&status=any
GraphQL:
{
customer(id: "gid://shopify/Customer/${id}") {
orders(first: 250, query: "status:any") {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
node {
id
}
cursor
}
}
}
}
Solved! Go to the solution
This is an accepted solution.
I figured this out, orders older than 60 days will not show up unless you request all orders access from the Partner app dashboard, NOT in the access scopes. Weird one...
This is an accepted solution.
I figured this out, orders older than 60 days will not show up unless you request all orders access from the Partner app dashboard, NOT in the access scopes. Weird one...
After you get access to read all orders scope, this is the response from Partner support:
Thanks for contacting Shopify. Your request to read all orders has been approved. Please update your application to also include the OAuth scope read_all_orders (alongside read_orders or write_orders) for all orders access to take into effect.