Warehouse products sort

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.

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

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

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

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.

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!

Any update on this issue?

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

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
      }
    }
  }
}
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.

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

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!

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:

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
  }

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!

This still doesn’t work

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

Hello @ahmed!

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

Kind Regards,
TomasFD