Duplicate orders in the orders graphql query

Hi,

We are making a query with warehouse_id and fulfillment_status query. There are about 2000 rows that match the query.

We do get the data, and using the endCursor to go to to next page with ‘after’ param, we notice that we get a lot of duplicate orders in the next query.

Within a single query, there are no duplicates, but when we use after:, we notice that we are getting duplicates.

How do we fix this ? because we are having to query shiphero many more times to get the full set as it seems there is an issue with cursor on your end.

here is the query we are runnign
query{
orders(
fulfillment_status: “xxx”,
warehouse_id: “yyy”
){
complexity
data {
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
edges {
cursor
node {
id
order_number
partner_order_id
subtotal
total_tax
total_discounts
total_price
line_items(first: 6) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
partner_line_item_id
quantity_allocated
locked_to_warehouse_id
}
}
}
}
}
}
}
}

I am still interested to know how to get around this. We are unable to trust the results from the api because of duplicate orders using ‘after’ param

Hi Dawa,
To get a closer look, can you send me a request id? Can you explain a little more what your seeing and what you should be seeing? Apologies, for the time-lapse. Thanks in advance

Hi Therasa,

We are trying to retrieve all orders in fulfillment_status ‘x’ that is locked to a warehouse. There are usually more than 100. How do we retrieve all of them ?

When we use the pagination using endCursor to navigate to the next page of result, we see a lot of duplicates. To illustrate what is happening

Let’s say we have 300 orders. Instead of having to do 3 queries with 100 orders each, when we tried this, we had to fetch 6-7 or more times to get all the data where the same orders would show up in multiple pages.

I think the query structure I put in the original question is how we tested.

Hi @Dawa!
We apologize for the delayed response about this.
Have you tried using date filters (order_date_from, order_date_to)?

Cursors are dynamic so maybe that might be causing the update on them and the duplicated results.
Let us know if this still doesn’t help.
Thanks again for the patience!,
Tom

1 Like