neo4j-graphql-java icon indicating copy to clipboard operation
neo4j-graphql-java copied to clipboard

Add support for aggregation queries

Open Andy2003 opened this issue 3 years ago • 0 comments

Augment schema with fields for aggregation queries.

Given schema

type Movie {
    id: ID
    actorCount: Int
    averageRating: Float
    isActive: Boolean
}

Should generate the following augmented schema (partial example with only relevant fields and types below):

type Query {
  moviesAggregate(where: MovieWhere): MovieAggregateSelection!
  moviesCount(where: MovieWhere): Int!
}

type MovieAggregateSelection {
  actorCount: IntAggregateSelection!
  averageRating: FloatAggregateSelection!
  count: Int!
  id: IDAggregateSelection!
}

type FloatAggregateSelection {
  average: Float!
  max: Float!
  min: Float!
}

type IDAggregateSelection {
  longest: ID!
  shortest: ID!
}

type IntAggregateSelection {
  average: Float!
  max: Int!
  min: Int!
}

Andy2003 avatar Nov 21 '21 16:11 Andy2003