# Order queries for 32 or less orders never complete

**URL:** https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920
**Category:** GraphQL API
**Created:** [March 22, 2022, 7:06pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920 "2022-03-22T19:06:04Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![jknechtv](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jknechtv](https://community.shiphero.com/u/jknechtv)
#### Post date: [March 22, 2022, 7:06pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/1 "2022-03-22T19:06:04Z")

</div>

I’ve encountered a weird issue in the past week. I’m building a query for orders and wanted to query a small amount of orders due to a handful of connections I want to make. It seems I can’t query for any number of orders less than 33. A request for 33, 50, 100, etc. orders completes in under a second. Queries for 32, 25, 15, 10, etc. never finish. I’ve seen request time run for over 300 seconds and still not receive a result.

I am making request from an Insomnia client.

Query I’m using (without connections)

```auto
query {
	orders {
		complexity
		data(first: 33) {
			edges {
				node {
					address_is_business
					billing_address {
						address1
						address2
						city
						company
						country
						country_code
						email
						first_name
						last_name
						phone
						state
						state_code
						zip
					}
					box_name
					email
					fulfillment_status
					id
					insurance
					order_date
					order_history {
						information
					}
					order_number
					packing_note
					partner_order_id
					profile
					require_signature
					shipping_address {
						address1
						address2
						city
						company
						country
						country_code
						email
						first_name
						last_name
						phone
						state
						state_code
						zip
					}
					shop_name
					source
					subtotal
					total_price
				}
			}
		}
	}
}

```

---

<div class="post-metadata">

### Author: ![JustinAnchored](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@JustinAnchored](https://community.shiphero.com/u/JustinAnchored)
#### Post date: [March 23, 2022, 5:21am UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/2 "2022-03-23T05:21:56Z")

</div>

You have a strange one, What I find is that its pulling the first orders back when you first started with shiphero. I’ve always found that it takes a while for older orders. now if you put in a date range, it may be better at populating. If I don’t have the dates, mine don’t finish, even if I have the 33,50 or 100

~Justin

---

<div class="post-metadata">

### Author: ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)
#### Post date: [March 24, 2022, 4:33pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/3 "2022-03-24T16:33:55Z")

</div>

Hello @jknechtv!

I already have our engineering team aware of this issue. I’ll add your example to the case ticket as well.

Just to confirm, are you getting an HTTP 504 timeout error?

Kind regards,  
TomasFD

---

<div class="post-metadata">

### Author: ![jknechtv](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jknechtv](https://community.shiphero.com/u/jknechtv)
#### Post date: [March 26, 2022, 12:42am UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/4 "2022-03-26T00:42:36Z")

</div>

Hey Tom, I actually haven’t bothered to let it run to time out so the request never returned. I.e. I got no HTTP status code. As mentioned above, I had at least 1 request reach over 300 seconds that still hadn’t returned

---

<div class="post-metadata">

### Author: ![tony](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tony](https://community.shiphero.com/u/tony)
#### Post date: [January 16, 2024, 8:41am UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/6 "2024-01-16T08:41:18Z")

</div>

Hello,

I have a very very similar issue on the `order_history` query. If I dont provide anything it gives me an internal server error. If I try to query exactly 1 matching result it never finishes the request.

---

<div class="post-metadata">

### Author: ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)
#### Post date: [January 16, 2024, 3:19pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/7 "2024-01-16T15:19:19Z")

</div>

Hello Tony,

Welcome to our community!

Can you confirm if by “I don’t provide anything” you mean you don’t even provide the order\_id of which you want to retrieve the history?

Have a nice day!  
TomasFD

---

<div class="post-metadata">

### Author: ![tony](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tony](https://community.shiphero.com/u/tony)
#### Post date: [January 16, 2024, 10:31pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/8 "2024-01-16T22:31:18Z")

</div>

correct. If I don’t provide an `order_id` or `order_number` or such it just results in an internal error. If I provide a uniquely identifying argument it queries indefinitely without ever responding meaning I have to manually abort the request.

EDIT: correction to my response. I just rechecked with both `order_id` and `order_number` (as we mainly use `order_number`) and it seems not providing these does not result in an error anymore.  
The only issue left is that querying for a specific value never finishes the request.

---

<div class="post-metadata">

### Author: ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)
#### Post date: [January 17, 2024, 6:19pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/9 "2024-01-17T18:19:07Z")

</div>

Hi @tony

That query requires to send at least order\_id or order\_number.

Can you share with me an example of one of those cases that never finishes? Is it a timeout or do you have access to a request\_id to share with me?

Have a nice day!

---

<div class="post-metadata">

### Author: ![tony](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tony](https://community.shiphero.com/u/tony)
#### Post date: [January 18, 2024, 8:37am UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/10 "2024-01-18T08:37:10Z")

</div>

Hey so the queries we noticed this with all look like this (exact order number redacted but format kept):

```gql
query Order_history {
    order_history(order_number: "US01234A") {
        data {
            edges {
                node {
                    id
                }
            }
        }
    }
}

```

This will never finish for some reason.

A query to `orders` finishes as expected when just giving the `order_number` like so:

```gql
query Order {
    orders(order_number: "US01234A") {
        data {
            edges {
                node {
                    id
                }
            }
        }
    }
}

```

The `order_history` query does finish if we don’t access `data` but for example `complexity`.

---

<div class="post-metadata">

### Author: ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)
#### Post date: [January 24, 2024, 2:38pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/11 "2024-01-24T14:38:12Z")

</div>

Hi @tony!

We pushed a fix for this scenario.

Can you confirm it is working now for you?

Best,  
TomasFD

---

<div class="post-metadata">

### Author: ![tony](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tony](https://community.shiphero.com/u/tony)
#### Post date: [January 24, 2024, 10:49pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/12 "2024-01-24T22:49:41Z")

</div>

Hey tomas

it works as expected now.

---

<div class="post-metadata">

### Author: ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)
#### Post date: [January 25, 2024, 8:36pm UTC](https://community.shiphero.com/t/order-queries-for-32-or-less-orders-never-complete/1920/13 "2024-01-25T20:36:27Z")

</div>

Hey @tony  
That is great news. Thanks for taking the time to check!
