Postgres: Aggregation Queries
You can fetch aggregations on columns along with nodes using an aggregation query.
The name of the aggregate field is of the form
<field-name> + _aggregate.
Common aggregation functions are
min, etc. You
can see the complete specification of the aggregate field in the API
reference. Note that not
all aggregation functions are available for all data types.
Fetch aggregated data of an object
Example: Fetch a list of articles with aggregated data of their rating:
Fetch aggregated data on nested objects
The following is an example of a nested object query with aggregations on the array relationship between an author and articles.
Example: Fetch author with id "1" and a nested list of articles with aggregated data of their rating: