I am using Gatsby + GraphQL + Shopify. I am having an issue retrieving my orders by the last 10.
My query looks like this:
query {
customer(customerAccessToken: "${customerAccessToken}") {
orders(last: 10) {...}
}
}
And it returns this:
"message": "using last without before is not supported"
I noticed this issue happening to some other devs:
If you check the docs it says nothing about using before
with last
:
/docs/admin-api/graphql/reference/object/order?api[version]=2020-07
There is a playground at the bottom where you can test queries.
Anybody else has seen this issue before?
I am using Gatsby + GraphQL + Shopify. I am having an issue retrieving my orders by the last 10.
My query looks like this:
query {
customer(customerAccessToken: "${customerAccessToken}") {
orders(last: 10) {...}
}
}
And it returns this:
"message": "using last without before is not supported"
I noticed this issue happening to some other devs: https://munity.shopify./c/Shopify-Discussion/How-to-get-customer-s-orders-and-sort-by-date-in-descending/m-p/629133/highlight/false#M151241
If you check the docs it says nothing about using before
with last
:
https://shopify.dev/docs/admin-api/graphql/reference/object/order?api[version]=2020-07
There is a playground at the bottom where you can test queries.
Anybody else has seen this issue before?
Share Improve this question asked Jul 6, 2020 at 22:02 NonNon 8,58920 gold badges80 silver badges130 bronze badges1 Answer
Reset to default 18After a few moments of playing with the playground ... you can use a workaround - reverse
and first
{
orders(first: 10, reverse:true) {
edges {
node {
id
createdAt
}
}
}
}