cancel
Showing results for 
Search instead for 
Did you mean: 

Custom aggregate with DISTINCT

aries_djay
Node

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

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.