neo4j-graphql / neo4j-graphql-java

Neo4j Labs Project: Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OptimizationStrategy FILTER_AS_MATCH breaks offset/first input attributes for queries

DirkMahler opened this issue · comments

We're using the FILTER_AS_MATCH optimization strategy for better performance on deep filters (see #63). Activating this feature breaks support for other query input attributes, e.g. executing

person(first:10) {
  name
}

results in the following exception:

org.neo4j.graphql.OptimizedQueryException: Querying without filter is not subject to the OptimizedFilterHandler
        at org.neo4j.graphql.handler.filter.OptimizedFilterHandler.generateFilterQuery(OptimizedFilterHandler.kt:41) ~[neo4j-graphql-java-1.0.0.jar!/:?]
        at org.neo4j.graphql.handler.QueryHandler.generateCypher(QueryHandler.kt:85) ~[neo4j-graphql-java-1.0.0.jar!/:?]
        at org.neo4j.graphql.handler.BaseDataFetcher.get(BaseDataFetcher.kt:72) ~[neo4j-graphql-java-1.0.0.jar!/:?]
        at org.neo4j.graphql.handler.BaseDataFetcher.get(BaseDataFetcher.kt:14) ~[neo4j-graphql-java-1.0.0.jar!/:?]
        at org.neo4j.graphql.Translator.toQuery(Translator.kt:84) ~[neo4j-graphql-java-1.0.0.jar!/:?]
        at org.neo4j.graphql.Translator.translate(Translator.kt:49) ~[neo4j-graphql-java-1.0.0.jar!/:?]

Affects release 1.1.0.