hasura / hasura/graphql-engine

Add support for sorting by json path in V3

Open
#10,018 2 comments 0 reactions 0 assignees View on GitHub
c/v3-ndc-postgres k/enhancement 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.