hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.09k stars 2.77k forks source link

V3: Aggregations, GroupBy support #10040

Open manasag opened 10 months ago

manasag commented 10 months ago

Aggregations and GroupBy support in GraphQL Schema.

Here is the RFC for the technical design that can be reviewed.

(Internal link: https://hasurahq.atlassian.net/browse/V3ENGINE-158)

noverby commented 8 months ago

Could you maybe consider removing the aggregate field so that:

query {
  articles_aggregate {
    aggregate {
      count
      sum {
        rating
      }
      avg {
        rating
      }
      max {
        rating
      }
    }
  }
}

Becomes:

query {
  articles_aggregate {
    count
    sum {
      rating
    }
    avg {
      rating
    }
    max {
      rating
    }
  }
}
manasag commented 4 months ago

@daniel-chambers can you share the RFC here.

@noverby I think the current milestone do not intend to tackle what you have asked. However this is something for note for us in future, and possibly as an aliasing feature (so that you can shape the graphql schema in a custom manner)