hasura / hasura/graphql-engine

`order_by` should be a list but can be an object

Open
#9,829 0 comments 0 reactions 0 assignees View on GitHub
k/bug t/native-dbs
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### What is the current behavior?

`order_by: [todos_order_by!]` means that it must be a list, however it also works with `order_by: {title: asc}`. This looks like a bug / broken implementation to me. Or is there any GraphQL feature that allows this?

### What is the expected behavior?

Using an object instead of a list should cause an error.
There should be an extra field like `order_by_many` for sorting by a list of columns.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing issue #9829 with the `order_by` and `todos_order_by` inputs described in the report, then locate the schema and input-validation entry points that handle them. Done means an object supplied where a list is declared is rejected, while the supported list form remains usable and any replacement such as `order_by_many` is documented by the resulting tests or schema behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.