I am trying to use last: 10 to get the last 10 orders.
The query:
customer(customerAccessToken: "${customerAccessToken}") {
orders(last: 10) {...}
}
returns: “message”: “using last without before is not supported”
Even here https://shopify.dev/docs/admin-api/graphql/reference/object/order?api[version]=2020-07 on the playground at the bottom, change first and set last instead so you will see the error I mentioned.
I posted the question on SO https://stackoverflow.com/questions/62765178/graphql-error-using-last-without-before-is-not-supported/62772930?noredirect=1#comment111020049_62772930 and that’s the answer I got.
{
orders(first: 10, reverse:true, sortKey:CREATED_AT) {
edges {
node {
id
createdAt
}
}
}
}
But (first:10, reverse:true) is not equal to (last:10), imagine you have 20 data [1,2,3…17,18,19,20] The 1st approach will return [10,9,8,7…3,2,1] while the 2nd will return [20,19,18…12,11,10].
Am I wrong? The point is that we need support for last. In the DOCs says we only need to use last with no other keys present.
DOCs: https://shopify.dev/docs/admin-api/graphql/reference/object/customer?api[version]=2020-07