I am trying to get ALL purchase orders across all accounts using a 3PL parent API key. I do not want to waste credits so I am getting only one record at a time passing the endCursor into the “after” for each subsequent record. Like this:
{purchase_orders(created_from:“2020-12-04”){request_id complexity data(sort:“created_at” first:1 after:“YXJyYXljb25uZWN0aW9uOjI1”){pageInfo{hasNextPage endCursor} edges{node{id account_id po_number created_at date_closed po_date arrived_at fulfillment_status vendor{name}}}}}}
RETURNS:
pageInfo": {
“hasNextPage”: true,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjI2”
}
{purchase_orders(created_from:“2020-12-04”){request_id complexity data(sort:“created_at” first:1 after:“YXJyYXljb25uZWN0aW9uOjI2”){pageInfo{hasNextPage endCursor} edges{node{id account_id po_number created_at date_closed po_date arrived_at fulfillment_status vendor{name}}}}}}
RETURNS:
“pageInfo”: {
“hasNextPage”: true,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjI3”
}
{purchase_orders(created_from:“2020-12-04”){request_id complexity data(sort:“created_at” first:1 after:“YXJyYXljb25uZWN0aW9uOjI3”){pageInfo{hasNextPage endCursor} edges{node{id account_id po_number created_at date_closed po_date arrived_at fulfillment_status vendor{name}}}}}}
etc…
When this process completes it skips Purchase Orders. The chain of cursors between calls appears to be skipping records.
Is this supposed to work? Am I doing something wrong? How should I page 1 record at a time on a “purchase_orders” query with a “created_from” parameter?