cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Custom aggregate with DISTINCT

I am using neo4j-graphql library with Apollo and I have this schema.

 

type Employee {
 name: String
 department: String
 city: String
}

 

I can get the total number of developers using the below graphql query

 

query EmployeeAggregate {
  employeeAggregate(where: { department: "Developer" }) {
    count
  }
}

 

 However, is there a graphql way to get the total number of unique departments rather than writing a custom cypher query using the DISTINCT keyword? Or is there a way to extend the in-built filters to enable filtering by DISTINCT?

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online