Orders Query Dropping Data

Whenever I run a query for orders with a ‘warehouse_id’ filter it seems to be dropping data and not giving me the full resultset.

eg. Here’s my query, which should return hundreds of orders:

query {
orders(
warehouse_id: “V2FyZWhvdXNlOjEyMjQ5”
order_date_from: “2020-04-01”

) {
complexity
data{
pageInfo{
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
order_date
}
}
}
}
}

The results show no pagination available and strange collection of elements:

{
“data”: {
“orders”: {
“complexity”: 101,
“data”: {
“pageInfo”: {
“hasNextPage”: false,
“hasPreviousPage”: false,
“startCursor”: “YXJyYXljb25uZWN0aW9uOjA=”,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjM5”
},
“edges”: [
{
“node”: {
“order_date”: “2020-04-07T14:13:16+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-08T17:32:38+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-14T14:42:46+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-17T20:04:34+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-21T17:28:11+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-21T21:07:55+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-21T21:14:23+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-23T16:49:05+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T00:23:34+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T00:36:54+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T01:37:56+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T04:07:21+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T05:53:03+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T09:58:52+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T10:01:53+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T10:33:21+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:17:07+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:17:34+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:17:47+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:19:11+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:21:59+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:36:39+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:37:03+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:38:59+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:45:31+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T11:58:49+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T12:40:38+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T13:03:50+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T13:29:45+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T14:48:41+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T14:52:52+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T14:53:01+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T14:58:46+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T14:59:21+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T15:06:40+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T15:09:25+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T15:10:19+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T15:17:36+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T15:27:35+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-01T15:32:29+00:00”
}
}
]
}
}
}
}

Now if I change my date to 2020-04-02 you’ll see some of the data that was missing from above response:

{
“data”: {
“orders”: {
“complexity”: 101,
“data”: {
“pageInfo”: {
“hasNextPage”: false,
“hasPreviousPage”: false,
“startCursor”: “YXJyYXljb25uZWN0aW9uOjA=”,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjM4”
},
“edges”: [
{
“node”: {
“order_date”: “2020-04-07T14:13:16+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-08T17:32:38+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-14T14:42:46+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-17T20:04:34+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-21T17:28:11+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-21T21:07:55+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-21T21:14:23+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-23T16:49:05+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T00:10:17+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T00:16:01+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T00:41:22+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T01:05:34+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T01:16:17+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T01:21:25+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T01:36:01+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T02:21:35+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T03:59:15+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T04:37:00+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T04:53:07+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T05:16:29+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T05:33:38+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T06:16:37+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:11:07+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:11:25+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:11:44+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:13:21+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:13:56+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:15:15+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:16:55+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T10:19:35+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T12:17:35+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T12:52:23+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T12:57:04+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T13:16:01+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T13:17:47+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T13:21:40+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T13:22:42+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T13:52:40+00:00”
}
},
{
“node”: {
“order_date”: “2020-04-02T13:57:40+00:00”
}
}
]
}
}
}
}

Hi @Mike!
That is because on your query you are only asking for the order_date.
What exactly are you looking to get from the orders?

In case it helps, we have an example here

Actually it happens even if I put more fields in. Technically, what I really want to fetch is this:

{
orders(
warehouse_id: “V2FyZWhvdXNlOjEyMjQ5”
order_date_from: “2020-04-02”
) {
data{
pageInfo{
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
order_number
id
packing_note
shipping_address
{
first_name
last_name
company
address1
address2
city
state
zip
country
email
phone
}
line_items
{
edges{
node{
sku
quantity
price
product_name
custom_options
}
}
}
}
}
}
}
}

But that gets me this error:

“There are not enough credits to perfom the requested operation, which requires 10001 credits, but the are only 1001 left. In 0:10:00 minutes you will have enough credits to perform the operation”,

So I figured maybe I have to remove the ‘line item’ and just get the ids with my query, then iterate through all the order ids and call the order() for each one with the line items.

This is basically the same as what I posted originally, but with id added in. (I didn’t want to post the actual order details on a forum so decided to just put the order timestamp as an example).

The same problem is happening for the query below i.e. I thought it should give me back all order ids after April 2nd, but I’m actually just getting around 20 of them and no access to pagination. There are hundreds of these orders and for some reason it only gives a small subset.

query {
orders(
warehouse_id: “V2FyZWhvdXNlOjEyMjQ5”
order_date_from: “2020-04-02”

) {
complexity
data{
pageInfo{
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
order_date
}
}
}
}
}

This results in the following:

{
“data”: {
“orders”: {
“complexity”: 101,
“data”: {
“pageInfo”: {
“hasNextPage”: false,
“hasPreviousPage”: false,
“startCursor”: “YXJyYXljb25uZWN0aW9uOjA=”,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjM4”
},
“edges”: [
{
“node”: {
“id”: “T3JkZXI6MTIxNzA2ODQ3”,
“order_date”: “2020-04-07T14:13:16+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxODQ0NDg5”,
“order_date”: “2020-04-08T17:32:38+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIyNTE5OTE2”,
“order_date”: “2020-04-14T14:42:46+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIyOTk0MDM1”,
“order_date”: “2020-04-17T20:04:34+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIzNTI5ODUz”,
“order_date”: “2020-04-21T17:28:11+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIzNTc4NzEz”,
“order_date”: “2020-04-21T21:07:55+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIzNTc5ODMx”,
“order_date”: “2020-04-21T21:14:23+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIzODMxMzU5”,
“order_date”: “2020-04-23T16:49:05+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDI4ODYz”,
“order_date”: “2020-04-02T00:10:17+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDI5NTU0”,
“order_date”: “2020-04-02T00:16:01+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDMxODg1”,
“order_date”: “2020-04-02T00:41:22+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDMzODY1”,
“order_date”: “2020-04-02T01:05:34+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDM0Njgz”,
“order_date”: “2020-04-02T01:16:17+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDM1MzYy”,
“order_date”: “2020-04-02T01:21:25+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDM2Mjc2”,
“order_date”: “2020-04-02T01:36:01+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDM5OTQ2”,
“order_date”: “2020-04-02T02:21:35+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDQ2NzMw”,
“order_date”: “2020-04-02T03:59:15+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDQ4ODcy”,
“order_date”: “2020-04-02T04:37:00+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDQ5NzE2”,
“order_date”: “2020-04-02T04:53:07+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDUxMDc2”,
“order_date”: “2020-04-02T05:16:29+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDUyMjM4”,
“order_date”: “2020-04-02T05:33:38+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDU1MDQ5”,
“order_date”: “2020-04-02T06:16:37+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY0OTAy”,
“order_date”: “2020-04-02T10:11:07+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY0OTEy”,
“order_date”: “2020-04-02T10:11:25+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY0OTM2”,
“order_date”: “2020-04-02T10:11:44+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY1MDY3”,
“order_date”: “2020-04-02T10:13:21+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY1MDgz”,
“order_date”: “2020-04-02T10:13:56+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY1MTcw”,
“order_date”: “2020-04-02T10:15:15+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY1MjY5”,
“order_date”: “2020-04-02T10:16:55+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDY1Mzk4”,
“order_date”: “2020-04-02T10:19:35+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDcxMDE0”,
“order_date”: “2020-04-02T12:17:35+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDczMzYz”,
“order_date”: “2020-04-02T12:52:23+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDczNjEy”,
“order_date”: “2020-04-02T12:57:04+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDc0NTc5”,
“order_date”: “2020-04-02T13:16:01+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDc0NzAy”,
“order_date”: “2020-04-02T13:17:47+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDc0OTMw”,
“order_date”: “2020-04-02T13:21:40+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDc0OTc1”,
“order_date”: “2020-04-02T13:22:42+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDc2Njgy”,
“order_date”: “2020-04-02T13:52:40+00:00”
}
},
{
“node”: {
“id”: “T3JkZXI6MTIxMDc2OTg1”,
“order_date”: “2020-04-02T13:57:40+00:00”
}
}
]
}
}
}
}

Why isn’t it including order ids from april 3rd, 4th, 5th etc. and paginating them all together if >100?

This is still unresolved can you please advise? I think you misread orders as order two different queries. Please carefully look at my examples.

Hey Mike!

I looked carefully at your examples to see if there was something you’re missing and I see exactly what you’re saying. We aren’t using the warehouse id filter to fetch orders, but we may be interested in doing that so I’d like to know this is solved if it’s a problem.

Could you re-run your first examples and include the request id in the response so you can provide those request ids to the development team? From what I’ve seen, that will help them to investigate this and determine whether it’s a bug (sounds like it is).

Not a ShipHero dev myself, just a client, but we’re all in this together.

Thank you!
-Sid

1 Like

Hi @Mike
I apologize I got that wrong!

So, as for why you are seeing the error of:

“There are not enough credits to perfom the requested operation, which requires 10001 credits, but the are only 1001 left. In 0:10:00 minutes you will have enough credits to perform the operation”,

That is because that Query exceeds the number of credits available, this is:

If you don’t specify data (first:10) it will assume that you want to get 100 by default, so in this case, the cost of the query would be

1 (cost by default) + 100(orders) * 100(line items each of the orders) = 10001

An alternative for this would be to fetch 10 orders with 100 line items each every > 15 seconds (because every 15 seconds the 1001 credits should be fully restored)

Or maybe 100 orders but 10 line items each? You can play with any combination here that works best for you

As for the other concern about warehouse_id filter not showing the expected orders, it will really help the request_id you are getting back (Thanks for mentioning it @originsid! ) that way with that id I can check the query and other information related to the account that will be able to help me understand if we are missing something or not
Thanks again for the patience!
Tom

Thanks Tom

Here’s a request ID:

5eb198bcbed9601085b2c77d

or

5eb199059ff8cc97de6d1271

Hi @Mike
Thank you very much for that information, I see what you are seeing now. It appears not to be filtering correctly by warehouse_id, so I already made a request to the engineering team to fix this.
I will let you know as soon as I have an update on this.
I appreciate your patience in this,
Tom

Has this been resolved yet?

Hi @Mike
I apologize for the delay with this. Our Engineers haven’t been able to work on this yet, but I will raise the priority of the ticket to see if I can speed this up.
I will let you know asap
Thanks again for the patience
Tom

Hi @Mike
I apologize once again for the delayed resolution about this.
A fix for this has been implemented by one of our engineers.
Please don’t hesitate to reach out if there is anything else we could help with.
Thanks again!
Tom