Paging one record at a time with first:1

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?

Hi @bbarrett
If you also include a created_to filter it still happens?
Thanks in advance!
Tom

I tried adding a created_to. No change. Is this required based on your design? I assumed it could be left unspecified.

I also tried passing “first:1000” and got a response with no next page. But it was still missing several 100 purchase orders.

In general, how should I run a query to get ALL the purchase orders in our account using a created_from?