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

Bring back the filter AND/OR #252

Open yarc opened 2 years ago

yarc commented 2 years ago

Hi, i cannot upgrade from 1.2.0 to 1.4.0 without this feature and 1.2.0, as it is, is not performant enough with our data. Here are some fairly common use cases:

The user is offered a list of product price ranges (1-10$, 11-20$, 21-30$...). The user can select any of the price ranges. In a query this is where we would produce an OR for each selected ranges.

The user is viewing a schedule of events and is offered the option to filter the events by calendar date, of which he can select multiple (non-contiguous) dates. In the data each event has a timestamp associated. There would be one OR filter per selected date, that does a event.startTime > $day AND event.endTime < $day

Lastly, we often use the "AND" filter to be able to add multiple filters that are based off the same relation. If we do not use an AND in these cases, all duplicate filters overwrite each other and only the last relation filter is preserved. This is also due to the fact that we pass in dynamic filters as a graphql variable.

Andy2003 commented 2 years ago

@yarc Can you please provide a testcase.