I’m actively troubleshooting missing records from warehouse_products, and I’m troubled by what I’ve found.
I’m using two queries: a bulk query which gets me all the warehouse_product records between two creation dates and an individual SKU query (which gets me the results of an individual SKU).
For this example, I’m looking for warehouse_products created between 2023-01-01 and 2023-02-01. When I get the results back from the bulk query, I would expect to find a SKU created on 2023-01-03 in the first page, but it isn’t there.
Here’s more information on the queries:
request_id from bulk query: 63dd52821209bdd36ce5f223
request_id from individual query: 63dd52c8b7c1372eb6a5a893
I’m quite concerned that we can’t trust the data coming out of the GraphQL API. Can someone please help us determine a root cause?
Hi @Rayanp. I’m still confused, but I might’ve provided the wrong request_ids.
You mentioned that SKU 40218850164835 should be the 100th result on Page 1 of the response. When I re-ran the bulk query (getting all warehouse_product records from 2023-01-01 to 2023-02-01), I don’t see the result. I would expect 40218850164835 to be on the first page as again it was created on “2023-01-03T01:26:11” and the last record on the bulk query response has a created_at timestamp of “2023-01-04T15:32:09.”
To clarify, what we’re ultimately trying to determine is if we’re missing warehouse_product records when we make requests using that “bulk query.” The aforementioned results leads me to believe that’s the case.
I believe whats happening here is the sorting order of the results.
By default they are sorted by warehouse_id - updated_at. You can use this value “YXJyYXljb25uZWN0aW9uOjExOTk=” as your after cursor which corresponds to position 1199, and you will see that in that page you get the jump from one WH to another.
You can try updated the code to this: data(first: $first, after: $after sort:"created_at") and they will be ordered by creation datetime regardless or their warehouse_id and updated_at date.