shop.fulfillmentOrders with "reverse:true" and "search" misinterprets "after" input

Tourist
7 0 4

Hi

 

Given the following query:

 

query getFulfillmentOrders(
  $query: String
  $first: Int
  $after: String
) {
  shop {
    fulfillmentOrders(
      first: $first
      after: $after
      query: $query
      includeClosed: true
      sortKey: ID
      reverse: true
    ) {
      edges {
        node {
          id
        }
        cursor
      }
      pageInfo {
        hasNextPage
        hasPreviousPage
      }
    }
  }
}

When using the above without specifying a "query", you can paginate through the edges by sending the after cursor using the last value in the returned list. However when you give it a query, in our case by "assigned_location_id", it seems the "after" is misinterpreted by the search system, as the comparison should also be reversed (ie. rather than use "id > $after" it should do "id < $after").

That would be nice to get fixed.

0 Likes
Tourist
7 0 4

Turns out the problem was that I was using the full id of the location, ie. "gid://shopify/Location/1234" rather than just "1234". That was a bit hard to understand from the documentation.

0 Likes