# Order by enum type

**URL:** <https://discuss.dgraph.io/t/order-by-enum-type/14292>\
**Category:** GraphQL\
**Tags:** kind:feature\
**Created:** [May 24, 2021, 3:23am UTC](https://discuss.dgraph.io/t/order-by-enum-type/14292 "2021-05-24T03:23:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdgamble555](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/jdgamble555/32/7503_2.png) [@jdgamble555](https://discuss.dgraph.io/u/jdgamble555)\
**Post date:** [May 24, 2021, 3:23am UTC](https://discuss.dgraph.io/t/order-by-enum-type/14292/1 "2021-05-24T03:23:03Z")

</div>

I am having a problem ordering by an **enum type** :

```auto
enum Direction {
  forward
  backward
}
type Garage {
  id
  name
  cars: [Car]
  ...
}
type Car {
  id: ID! 
  direction: Direction! @search
  ...
}

```

And my query:

```auto
queryGarage(filter: {id: [$id] } ) {
  id
  name
  cars (order: { asc: direction } ) {
    direction
    name
  }
}

```

And I get this message:

`"input:11: Expected type CarOrderable, found direction.\n"`

However, when I do `order: { asc: name }` I get no problems…

Can I sort by the **enum type**?

J

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [May 24, 2021, 4:38am UTC](https://discuss.dgraph.io/t/order-by-enum-type/14292/2 "2021-05-24T04:38:52Z")

</div>

You can’t have an index on enums at the moment. So you can’t use it as a sort key. I’m marking this as a feature request.

@hardik will prioritize

---

<div class="post-metadata">

**Author:** ![himanshu-msphere](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/himanshu-msphere/32/11744_2.png) [@himanshu-msphere](https://discuss.dgraph.io/u/himanshu-msphere)\
**Post date:** [February 5, 2025, 6:16am UTC](https://discuss.dgraph.io/t/order-by-enum-type/14292/3 "2025-02-05T06:16:59Z")

</div>

Any update on this?
