Showing results for 
Search instead for 
Did you mean: 

Neo4j-graphql-java translator issue

Node Link

HI all i am trying translate graphql query to cypher for normal string the translated query is working fine when i am trying to filter with DateTime the translated query seems to be wrong..
I have added Schema and Translated cypher query pls help me on this

my graph ql Schema

type Person{
	confirmedtime: DateTime
	healthstatus: String
	name: String

graphQl Query

query{  Person(confirmedtime:{year:2021,month:5}){   healthstatus  name}}

This query works well in graphql-js but not in java

Cypher Translated

[Cypher(query=MATCH (person:Person)
WHERE person.confirmedtime = $personConfirmedtime
RETURN person {
} AS Person, params={personConfirmedtime={year=2021, month=5}}, type=[Person], variable=Person)]

When I run this query and params in neo4j-java driver it throws error
org.neo4j.driver.exceptions.ClientException: Property values can only be of primitive types or arrays thereof

This is how i have translated from Java

URL url = Resources.getResource("schema.graphqls");

		String sdl = Resources.toString(url, Charsets.UTF_8);

		GraphQLSchema graphQLSchema = SchemaBuilder.buildSchema(sdl);
		Translator trans = new Translator(graphQLSchema);
		List<Cypher> cypher = trans.translate(query);

for the same graph ql query js was able to translate cypher query
Please help me on this
Thanks !!

Nodes 2022
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.