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

Incorrect query translation for @property(name:"testIds.uuid")

mdiadia-rft opened this issue · comments

Hello

Given type:

type User {
    userId: ID!
    uuid: String @property(name:"testIds.uuid")
}

And GraphQL query:

{
  user(filter: {uuid:"test-uuid"}) {
    userId
    uuid
  }
}

Method translate generates wrong filter condition(WHERE section), using method translate into class Translator.kt:

MATCH (user:User) 
WHERE user.uuid= 'test-uuid'
RETURN user { .userId, uuid:user.`testIds.uuid`} AS user

But query should be:

MATCH (user:User) 
WHERE user.`testIds.uuid`= 'test-uuid'
RETURN user { .userId, uuid:user.`testIds.uuid`} AS user

Actual result: empty object is returned.

Possible places to fix:
Predicates.kt#toExpression line 120
Predicates.kt#resolvePredicate line 33(be aware about dots in filter placeholders)

Thanks

Resolved by #171