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

maketroli
Tourist
3 0 2

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.
 
Replies 2 (2)
dylanpierce
Shopify Partner
160 3 67

Also experiencing the same bug with the below query:

            {
              orders(last: 10) {
                edges {
                  node {
                    id
                    email
                    name
                    phone
                  }
                }
              }
            }

 

But, the same query works in the  GraphQL explorer Shopify app. 

Founder of Verdict - Anti-Fraud Apps for Shopify
  • Blockade - Easily block countries, IP addresses, VPNs
  • Real ID - Verify your customer's real IDs easily & securely
johnAirRobe
Shopify Partner
4 1 0

I'm getting the same issue for the following query which according to the documentation I can use:

 query {
  currentAppInstallation {
    allSubscriptions(last: 2) {
      edges {
        node {
          lineItems {
            plan {
              pricingDetails {
                __typename
                ... on AppRecurringPricing {
                  price {
                    amount
                    currencyCode
                  }
                }
                ... on AppUsagePricing {
                  balanceUsed {
                    amount
                    currencyCode
                  }
                  cappedAmount {
                    amount
                    currencyCode
                  }
                }
              }
            }
          }
          createdAt
          id
          name
          status
          test
        }
      }
    }
  }
}