I am trying to query shipments with Pagination, but I also want to use the data limit to limit 30 shipments per request. However, what I notice is that ShipHero does not return the link to next cursor when I use data limit. Any suggestions. Please see a sample request I am making.
query {
orders(
warehouse_id: “V2XXXXXXXXXXXXODY=”
fulfillment_status:“fulfilled”
updated_from: “2020-11-06”
) {
request_id
complexity
data(first: 5) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
legacy_id
order_number
partner_order_id
fulfillment_status
order_date
auto_print_return_label
…
I know for the fact there are about 75 Shipments so I am expecting ShipHero to give me link to next page. However, this is what I see. Note that has next page is false.
The reason we want to limit number of records per request is that way we consume far less credits. We noticed that as soon as we remove the data limit, ShipHero consumes all credits we have irrespective of how may documents are returned. Is there something I am not dong correct here?
HI @goutham!
Is there any chance you could include the request_id ?
That way I would be able to access the full query, check the data that it will be pulling, and evaluate if this could be optimized in some way.
Thanks in advance!
Tom
Hi Tomas
Thanks for offering to help. Please see the request id below.
“data”: {
“orders”: {
“request_id”: “5faac56acdb476b348047a1c”,
“complexity”: 101,
“data”: {
“pageInfo”: {
“hasNextPage”: false,
“startCursor”: “YXJyYXljb25uZWN0aW9uOjA=”,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjE=”
},
Hi @goutham!
I apologize for my delayed response to this.
I made a ticket for our engineers to take a look at it, it seems to be related to the warehouse_id filter on the Query.
In the meantime, you can try removing the warehouse_id, that should not return you any inconsistencies.
I noticed that you also have just one warehouse, so for that purpose, it should be fine.
Let me know if that wouldn’t work for you.
Thanks again!
Tom
Hi Tomas
Looks like we have run into another Pagination issue.
If you look at this request id :5fc5b9a0dd472dac2f5d802f. The query we ran for first 500 records returns hasNextpage as false
I ran the same query by reducing the page count to first 300 pages and as expected hasNext is now true as seen below
request id : 5fc5ba23e60095f8f649f2e2
Now I am using the endCursor and getting the next set of pages. Ideally, I should get no more than 200 more records, but I keep on getting hasNext page true indefinitely like an endless loop.
Here are the request for next few executions with endCursor
5fc5ba960ddcdaf69e9f8264
5fc5bac58b4f0d7bfffc0a0c
5fc5badd1b025cd3310fc358
Hi @goutham!
My apologies for the delayed response about this.
I see you are only including the from filter (updated_from) but not updated_to, which in your case if your 3PL is currently fulfilling orders it might happen that the end cursor by the time you query, it might not match the “real” one.
Sounds like this would be the case? and if you include the updated_to it keeps happening (this endless loop)?