# Products query maxes at 30, uses too many credits

**URL:** <https://community.shiphero.com/t/products-query-maxes-at-30-uses-too-many-credits/716>\
**Category:** GraphQL API\
**Created:** [August 31, 2020, 9:39pm UTC](https://community.shiphero.com/t/products-query-maxes-at-30-uses-too-many-credits/716 "2020-08-31T21:39:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bubblynick](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bubblynick](https://community.shiphero.com/u/bubblynick)\
**Post date:** [August 31, 2020, 9:39pm UTC](https://community.shiphero.com/t/products-query-maxes-at-30-uses-too-many-credits/716/1 "2020-08-31T21:39:40Z")

</div>

We use the products query to get all of the products in the system a few times a day. This allows us to get the updated size/weight, the allocated qty, available qty, and backordered qty, and the kits and components of the kits.

With the original api, this was a single call and all of the data was there. With graph, I’m not able to request more than 30 products at a time or I get a credit error (even if this is the first call of the day).

Also after I do get the first batch, I have to wait anywhere from 2 - 20 seconds for more credits. We have thousands of products. What used to be a single few-second request is now going to take hours or longer.

Am I doing something wrong? If not, this makes Shiphero useless for us. Here’s my query. Notice I’m only requesting 30 at a time.

query {  
products {  
request\_id  
complexity  
data(first:30) {  
pageInfo {  
hasNextPage  
endCursor  
}  
edges {  
node {  
id  
name  
sku  
dimensions {  
height  
width  
length  
weight  
}  
warehouse\_products {  
warehouse\_id  
on\_hand  
available  
backorder  
allocated  
inventory\_bin  
inventory\_overstock\_bin  
reserve\_inventory  
updated\_at  
}  
kit  
active  
tags  
kit\_components {  
sku  
quantity  
}  
}

```
  }
}

```

}  
}

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [August 31, 2020, 10:45pm UTC](https://community.shiphero.com/t/products-query-maxes-at-30-uses-too-many-credits/716/2 "2020-08-31T22:45:58Z")

</div>

Hi @bubblynick!  
Would using Inventory Snapshot: [https://developer.shiphero.com/inventory-snapshot/](https://developer.shiphero.com/inventory-snapshot/)  
and complementing with the products query, filtering by `updated_from` & `updated_to`  
Sounds like an alternative for your flow?  
Thanks in advance!  
Tom

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [August 31, 2020, 10:48pm UTC](https://community.shiphero.com/t/products-query-maxes-at-30-uses-too-many-credits/716/3 "2020-08-31T22:48:26Z")

</div>

Also, if not extremely necessary I would suggest avoiding the `available` field, [because the field itself has an extra complexity due to the number of calculations it makes.](https://developer.shiphero.com/gotchas#available)

---

<div class="post-metadata">

**Author:** ![bubblynick](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bubblynick](https://community.shiphero.com/u/bubblynick)\
**Post date:** [September 1, 2020, 12:31am UTC](https://community.shiphero.com/t/products-query-maxes-at-30-uses-too-many-credits/716/4 "2020-09-01T00:31:00Z")

</div>

Hey Tom,

Thanks for the very fast help with this. The available field was a huge tip. It reduced the complexity by more than 10x. I see now that was mentioned on the gotchas page, but didn’t realize it was associated with the products call.

That might be enough for us to make proper queries to the products now, since I can request 100 now when not including the available field, which is not needed for us. On Hand is good enough. Trying it now, but looking good so far.

Thanks again  
Nick
