Skip to content

Commit f83a93b

Browse files
authored
docs: update example for using this in custom cypher (#175)
1 parent fe6f68a commit f83a93b

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

modules/ROOT/pages/directives/custom-logic.adoc

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,17 @@ Global variables are available for use within the Cypher statement, and can be a
2020
a|
2121
[source, graphql, indent=0]
2222
----
23-
{
24-
Movie {
25-
title
26-
actors: ACTED_IN @this {
27-
role
28-
actor {
29-
name
30-
}
31-
}
32-
directors: DIRECTED @this {
33-
director {
34-
name
35-
}
36-
}
37-
}
23+
type Movie {
24+
title: String
25+
similarMovies(limit: Int = 10): [Movie]
26+
@cypher(
27+
statement: """
28+
MATCH (this)<-[:ACTED_IN]-(:Actor)-[:ACTED_IN]->(rec:Movie)
29+
WITH rec, COUNT(*) AS score ORDER BY score DESC
30+
RETURN rec LIMIT $limit
31+
""",
32+
columnName: "rec"
33+
)
3834
}
3935
----
4036

0 commit comments

Comments
 (0)