Why the last filter doesn't work? Error: "using last without before is not supported"

Highlighted
New Member
3 0 0

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.
 
 
{
  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.
 
0 Likes