Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter arguments as variable #251

Open
yarc opened this issue Nov 16, 2021 · 1 comment
Open

Filter arguments as variable #251

yarc opened this issue Nov 16, 2021 · 1 comment
Labels
wait for answer Further information is requested

Comments

@yarc
Copy link

yarc commented Nov 16, 2021

I'm currently running 1.2.0 in my project and encountered this error while upgrading to 1.4.0.

If i try to use a query variable for a Filter argument, the query crashes.

query test($filter: _UserFilter) {
user(filter: $filter) {
id
name
}
}

class graphql.language.VariableReference cannot be cast to class graphql.language.ObjectValue (graphql.language.VariableReference and graphql.language.ObjectValue

java.lang.ClassCastException: class graphql.language.VariableReference cannot be cast to class graphql.language.ObjectValue (graphql.language.VariableReference and graphql.language.ObjectValue are in unnamed module of loader 'app')
at org.neo4j.graphql.handler.filter.OptimizedFilterHandler.generateFilterQuery(OptimizedFilterHandler.kt:54) ~[neo4j-graphql-java-1.4.0.jar:na]
at org.neo4j.graphql.handler.QueryHandler.generateCypher(QueryHandler.kt:116) ~[neo4j-graphql-java-1.4.0.jar:na]
at org.neo4j.graphql.handler.BaseDataFetcher.get(BaseDataFetcher.kt:29) ~[neo4j-graphql-java-1.4.0.jar:na]
at org.neo4j.graphql.handler.BaseDataFetcher.get(BaseDataFetcher.kt:20) ~[neo4j-graphql-java-1.4.0.jar:na]
at com.sherpa.aggregator.core.providers.GraphQLBaseSchemaProvider$Neo4jDataFetcher.fetchData(GraphQLBaseSchemaProvider.java:101) ~[classes/:na]
at org.neo4j.graphql.SchemaBuilder$addDataFetcher$$inlined$forEach$lambda$1.get(SchemaBuilder.kt:216) ~[neo4j-graphql-java-1.4.0.jar:na]
at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:270) ~[graphql-java-16.2.jar:na]
at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:203) ~[graphql-java-16.2.jar:na]
at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:60) ~[graphql-java-16.2.jar:na]
at graphql.execution.Execution.executeOperation(Execution.java:165) ~[graphql-java-16.2.jar:na]
at graphql.execution.Execution.execute(Execution.java:104) ~[graphql-java-16.2.jar:na]
at graphql.GraphQL.execute(GraphQL.java:557) ~[graphql-java-16.2.jar:na]
at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:482) ~[graphql-java-16.2.jar:na]
at graphql.GraphQL.executeAsync(GraphQL.java:446) ~[graphql-java-16.2.jar:na]
at graphql.GraphQL.execute(GraphQL.java:377) ~[graphql-java-16.2.jar:na]

@Andy2003
Copy link
Collaborator

@yarc Can you please test with the current master to see if the problem persists? If so can you provide a testcase.

@Andy2003 Andy2003 added the wait for answer Further information is requested label Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wait for answer Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants