# Warehouse products sort

**URL:** <https://community.shiphero.com/t/warehouse-products-sort/809>\
**Category:** GraphQL API\
**Created:** [September 16, 2020, 3:38pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809 "2020-09-16T15:38:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunKD](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@shaunKD](https://community.shiphero.com/u/shaunKD)\
**Post date:** [September 16, 2020, 3:38pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/1 "2020-09-16T15:38:42Z")

</div>

Hello,

I’ve noticed that I can’t sort on the updated\_at field when I fetch warehouse products. Here is my query

query {  
warehouse\_products(warehouse\_id: “\<warehouse\_id\>”, updated\_from: “2020-09-11T19:57:13+00:00”) {  
request\_id  
complexity  
data(sort: “updated\_at”, first: 10) {  
edges {  
node {  
id  
account\_id  
on\_hand  
inventory\_bin  
reserve\_inventory  
reorder\_amount  
reorder\_level  
updated\_at  
custom  
}  
cursor  
}  
}  
}  
}

The results aren’t sorted according to the updated\_at field and changing to sort: “+updated\_date” makes no difference either.

Please advice.

---

<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:** [September 16, 2020, 8:13pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/2 "2020-09-16T20:13:12Z")

</div>

Hi @shaunKD  
Thanks for those details and for reporting this.  
It is now currently working, but I submitted a ticket for our engineers to work on this.  
Thanks again, and I will provide an update as soon as I have a response about this.  
Tom

---

<div class="post-metadata">

**Author:** ![Eduardo](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@Eduardo](https://community.shiphero.com/u/Eduardo)\
**Post date:** [January 25, 2021, 12:10pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/3 "2021-01-25T12:10:19Z")

</div>

Hello, same error here.  
I’ve noticed this error is still unsolved, any update?

---

<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 26, 2021, 2:35pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/4 "2021-01-26T14:35:42Z")

</div>

Hi @Eduardo!  
My apologies for the delay with this. We don’t have an update yet, but we raised this ticket’s priority.  
Thanks for the patience while we work on this!  
Tom

---

<div class="post-metadata">

**Author:** ![atlatin](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@atlatin](https://community.shiphero.com/u/atlatin)\
**Post date:** [March 1, 2021, 9:17pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/5 "2021-03-01T21:17:25Z")

</div>

We noticed this isn’t working for Locations under warehouse\_products either. For example:

query {  
product(sku: “skuhereid”){  
request\_id  
complexity  
data {  
name  
warehouse\_products{  
on\_hand  
backorder  
allocated  
locations (first:7 sort: “-quantity”) {  
edges {  
node {  
location\_id  
quantity  
}  
}  
}  
}  
}  
}  
}

Doesn’t sort it by quantity in locations.

---

<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:** [March 9, 2021, 1:18am UTC](https://community.shiphero.com/t/warehouse-products-sort/809/6 "2021-03-09T01:18:36Z")

</div>

Thanks for bringing that up @atlatin!  
We also included that on our internal engineering ticket. We will keep you updated on the progress, thanks in advance!

---

<div class="post-metadata">

**Author:** ![Eduardo](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@Eduardo](https://community.shiphero.com/u/Eduardo)\
**Post date:** [August 12, 2021, 2:42pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/7 "2021-08-12T14:42:26Z")

</div>

Any update on this issue?

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [August 12, 2021, 8:13pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/8 "2021-08-12T20:13:32Z")

</div>

Hi Eduardo,  
I just ran this sort, and it went through fine.

```auto
query {
  warehouse_products(
    warehouse_id: "<warehouse_id here>"
    updated_from: "2021-07-29T19:57:13+00:00"
  ) {
    request_id
    complexity
    data(sort: "+updated_at", first: 10) {
      edges {
        node {
          id
          account_id
          on_hand
          inventory_bin
          reserve_inventory
          reorder_amount
          reorder_level
          updated_at
          custom
        }
        cursor
      }
    }
  }
}

```

```auto
query {
  product(sku: "<sku here>") {
    request_id
    complexity
    data {
      name
      warehouse_products {
        on_hand
        backorder
        allocated
        locations(first: 7, sort: "-quantity") {
          edges {
            node {
              location_id
              quantity
            }
          }
        }
      }
    }
  }
}

```

This query is working as well. Please send the request-id if you are still seeing issues.

---

<div class="post-metadata">

**Author:** ![josh.smith](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@josh.smith](https://community.shiphero.com/u/josh.smith)\
**Post date:** [August 23, 2021, 5:33pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/10 "2021-08-23T17:33:32Z")

</div>

Is there a reason the Warehouse\_Products sort might work for @Theresa but not @Eduardo or myself? We’ve even run @Theresa query and it does not change ascending or descending

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [August 23, 2021, 5:55pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/12 "2021-08-23T17:55:38Z")

</div>

Hi Eduardo,  
Are you still not seeing the data being sorted properly? Please send the request id and any errors that your receiving. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![PierreM](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@PierreM](https://community.shiphero.com/u/PierreM)\
**Post date:** [September 28, 2021, 12:22pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/15 "2021-09-28T12:22:09Z")

</div>

Hello @Theresa,  
we also have an issue with the sorting.  
It looks like the sort parameter is just ignored, I can set any random value.  
Other endpoints like `products` will trigger an error if I put a random value. And of course, a valid field will do the sorting correctly.  
Here the request id : 6153071e47f79c447446124e  
And the request:

```auto
query WarehouseProducts(
    $warehouseId: String
    $customerId: String
    $active: Boolean
    $sku: String
    $analyze: Boolean
  ) {
    warehouse_products(
      warehouse_id: $warehouseId
      customer_account_id: $customerId
      active: $active
      sku: $sku
      analyze: $analyze
    ) {
      complexity
      request_id
      data(
        sort: "on_hand"
        first: 10
      ) {
        pageInfo {
          ...PageInfoFragment
        }
        edges {
          node {
            
            ...WarehouseProductFragment
          }
        }
      }
    }
  }
  
  fragment WarehouseProductFragment on WarehouseProduct {
    on_hand
    available
    backorder
  }
  
  fragment PageInfoFragment on PageInfo {
    hasNextPage
    endCursor
    hasPreviousPage
    startCursor
  }

```

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [September 28, 2021, 6:05pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/16 "2021-09-28T18:05:53Z")

</div>

Hi Pierre,  
I do see that we have an engineering ticket for this but do not have an update. I will see if I can get some eyes on it!

---

<div class="post-metadata">

**Author:** ![kolbykskk](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@kolbykskk](https://community.shiphero.com/u/kolbykskk)\
**Post date:** [November 5, 2021, 7:45pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/17 "2021-11-05T19:45:54Z")

</div>

This still doesn’t work

---

<div class="post-metadata">

**Author:** ![Ahmed](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@Ahmed](https://community.shiphero.com/u/Ahmed)\
**Post date:** [February 21, 2022, 8:21am UTC](https://community.shiphero.com/t/warehouse-products-sort/809/18 "2022-02-21T08:21:00Z")

</div>

Is there any update on this? @tomasw @Theresa @KP2020

---

<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:** [February 21, 2022, 12:46pm UTC](https://community.shiphero.com/t/warehouse-products-sort/809/19 "2022-02-21T12:46:08Z")

</div>

Hello @ahmed!

I just asked our engineering team for an update on this.

Kind Regards,  
TomasFD
