Skip to content

wrong (this) parameter value for cypher directive on relationship #245

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

Closed
ikwattro opened this issue Oct 28, 2021 · 0 comments · Fixed by #246
Closed

wrong (this) parameter value for cypher directive on relationship #245

ikwattro opened this issue Oct 28, 2021 · 0 comments · Fixed by #246

Comments

@ikwattro
Copy link
Contributor

Given the following schema :

type Role @relation(name:"ACTED_IN", from:"actor", to:"movie") {
   actor: Person
   movie: Movie
   roles: [String]
   type: String @cypher(statement:"""
     RETURN type(this)
     """)
}

type Person {
  name: String
  born: Int
  roles: [Role]
  _all: String
  _id: ID!
}

type Movie {
  title: String
  released: Int
  characters: [Role]
  _all: String
  _id: ID!
  _labels: [String] @cypher(statement:"""
  RETURN labels(this)
  """)
}

And the following query :

query {
  person(first: 1) {
    roles {
      type
    }
  }
}

The generated query is :

MATCH (person:Person)
RETURN person {
	roles: [(person)-[personRoles:ACTED_IN]->(personRolesMovie:Movie) | personRoles {
		type: apoc.cypher.runFirstColumnSingle('WITH $this AS this RETURN type(this)',  {
			this: personRolesMovie
		})
	}]
} AS person LIMIT $personFirst

The parameter value given for this is wrong. It should be personRoles instead of personRolesMovie .

Failing test here : ikwattro@d75a90e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant