ElasticGraph Query API: Aggregation Counts

The aggregations API allows you to count documents within a grouping:

query ArtistCountsByCountry {
  artistAggregations {
    nodes {
      groupedBy {
        bio { homeCountry }
      }

      count
    }
  }
}

This query, for example, returns a grouping for each country, and provides a count of how many artists call each country home.