neo4j-graphql / neo4j-graphql-java

Neo4j Labs Project: Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher
Apache License 2.0
105 stars 49 forks source link

Add ability to specify null ordering (i.e. nullsFirst and nullsLast) in sorts #308

Open isstabb opened 12 months ago

isstabb commented 12 months ago

Being able to specify null ordering is a common approach (see nullsFirst and nullsLast in https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html). By default cypher puts nulls last on ascending and first on descending. But that is not always desirable, e.g. when sorting priorities descending, perhaps null priorities should not be above highest priorities.

Attempted workarounds include:

A working workaround is to change the data in some way to facilitate the sort.