# Getting 22 error when querying for Warehouse Products

**URL:** <https://community.shiphero.com/t/getting-22-error-when-querying-for-warehouse-products/306>\
**Category:** GraphQL API\
**Created:** [January 22, 2020, 12:35pm UTC](https://community.shiphero.com/t/getting-22-error-when-querying-for-warehouse-products/306 "2020-01-22T12:35:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubix3](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@rubix3](https://community.shiphero.com/u/rubix3)\
**Post date:** [January 22, 2020, 12:35pm UTC](https://community.shiphero.com/t/getting-22-error-when-querying-for-warehouse-products/306/1 "2020-01-22T12:35:15Z")

</div>

Hello -

I am trying to query warehouse products and when sending my request I am receiving a 22 error. Any chance someone here can help me diagnose?

**Query:**  
query {  
warehouse\_products {  
data(first: 1) {  
edges {  
node {  
id  
legacy\_id  
account\_id  
warehouse\_id  
price  
value  
on\_hand  
reserve\_inventory  
allocated  
available  
created\_at  
updated\_at  
}  
}  
}  
}  
}

**Result:**  
{  
“errors”: [  
{  
“message”: “Unexpected Error”,  
“operation”: “warehouse\_products”,  
“field”: “data”,  
“request\_id”: “5e2840334189d00919bd7956”,  
“code”: 22  
}  
],  
“data”: {  
“warehouse\_products”: {  
“data”: null  
}  
}  
}

Thank you!  
rubix3

---

<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:** [January 22, 2020, 2:18pm UTC](https://community.shiphero.com/t/getting-22-error-when-querying-for-warehouse-products/306/2 "2020-01-22T14:18:15Z")

</div>

Hi @rubix3 !  
It looks like you are missing the warehouse on your query. You have to specify this in order to access the products from that warehouse.  
It should look something like this:

```
query {
  warehouse_products(warehouse_id: "V2FyZWhvrfHuNlOjcx21") {
    data(first: 1) {
      edges {
        node {
          id
          legacy_id
          account_id
          warehouse_id
          price
          value
          on_hand
          reserve_inventory
          allocated
          available
          created_at
          updated_at
        }
      }
    }
  }
}

```

Please let me know if this doesn’t help!  
Thanks  
Tom

---

<div class="post-metadata">

**Author:** ![rubix3](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@rubix3](https://community.shiphero.com/u/rubix3)\
**Post date:** [January 23, 2020, 1:32pm UTC](https://community.shiphero.com/t/getting-22-error-when-querying-for-warehouse-products/306/3 "2020-01-23T13:32:54Z")

</div>

Hello @tomasw -

Thank you! That fix was the reason I was getting the error.

rubix3
