You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
age(mult:Int=13) : [Int] @cypher(statement:"RETURN this.age * mult as age")
15
+
}
16
+
type Query {
17
+
person : [Person]
18
+
}
19
+
"""
20
+
21
+
@Test
22
+
funrenderCypherDirective() {
23
+
24
+
val expected ="""MATCH (person:Person) RETURN person { name:apoc.cypher.runFirstColumnSingle('WITH ${"$"}this AS this RETURN this.name',{this:person}) } AS person"""
25
+
val query ="""{ person { name }}"""
26
+
assertQuery(query, expected, emptyMap())
27
+
}
28
+
29
+
@Test
30
+
funrenderCypherDirectiveWithParamsDefaults() {
31
+
32
+
val expected ="""MATCH (person:Person) RETURN person { age:apoc.cypher.runFirstColumnMany('WITH ${"$"}this AS this ,${'$'}mult AS mult RETURN this.age * mult as age',{this:person,mult:${'$'}personMult}) } AS person"""
33
+
val query ="""{ person { age }}"""
34
+
assertQuery(query, expected, mapOf("personMult" to 13))
35
+
}
36
+
37
+
@Test
38
+
funrenderCypherDirectiveWithParams() {
39
+
40
+
val expected ="""MATCH (person:Person) RETURN person { age:apoc.cypher.runFirstColumnMany('WITH ${"$"}this AS this ,${'$'}mult AS mult RETURN this.age * mult as age',{this:person,mult:${'$'}personMult}) } AS person"""
41
+
val query ="""{ person { age(mult:25) }}"""
42
+
assertQuery(query, expected, mapOf("personMult" to 25L))
0 commit comments