hasura / hasura/graphql-engine
Add support for sorting by json path in V3
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
This request was originally created here #2592 . This issue is to track this feature request in Hasura V3. Details:
The ability to sort the query results by a path of a JSON columns
For example, for a table like
```
CREATE TABLE products (
id serial NOT NULL PRIMARY KEY,
translated_name jsonb NULL
);
```
I would like to have the ability to do something like
```
query productsSortedByName {
products(order_by: {translated_name: {path: "en", how: asc_nulls_last}}) {
id
name: translated_name (path: "en")
}
}
```
Contributor guide
Research direction
Start by reading the original request in #2592 and tracing how Hasura V3 represents JSON-column paths and order_by arguments. Use the products example as the target behavior; done means a GraphQL query can sort by a JSON path with the requested null-ordering semantics. The payload names no implementation files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, postgresql
- Domain
- api, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100