Ordering by nested field

Sorting using a nested field is currently not supported.

As a possible workaround, you may include dateTime: DateTime field directly inside type Task .
If that is done, the following query will be able to fetch tasks sorted according to Date for the User.

query{
  queryUser{
    name
    tasks(order:{asc:dateTime}){
      title
    }
  }
}

I am trying to understand your use case here. Is there any specific reason that ReportedDate has been as a separate type rather than having dateTime: DateTime field inside type Task.

If your use case is fairly common and there is no other way to do this, we can accept this as a feature request. It will then be be worked upon along with supporting nested filters.

1 Like