hasura / hasura/graphql-engine

🧪 Scalability: The ability to aggregate "row_number" and "rank" by "count'.

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

Description

### Is your proposal related to a problem?

Described what I'm trying to achieve here:
[https://github.com/hasura/graphql-engine/discussions/8923](https://github.com/hasura/graphql-engine/discussions/8923)

### Describe the solution you'd like

An easy way to run an aggregate that returns the `row_number()`, and `rank()`, over a value such as count, sum, etc. Absolutely essential when designing systems like leaderboards at scale.

### Describe alternatives you've considered

Tried getting the raw SQL query from "Analyze" and tinkering around with it, but couldn't get to a successful result. A built-in solution would save hours of work and help unlock an essential way to use Hasura aggregations at scale.

![image](https://user-images.githubusercontent.com/8274669/188320875-1f1fc705-0d89-448e-aa7e-4bc114cce613.jpeg)

Contributor guide

Open the contributing guide

Research direction

Start with the linked discussion #8923 and the raw SQL produced by Analyze, since no implementation files or tests are named. Determine how GraphQL aggregates currently represent count and sum, then define what exposing row_number() and rank() over those values would require; done means the requested leaderboard-style aggregate is available through the API.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, sql
Domain
api, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.