Skip to content

Commit c3d0284

Browse files
authored
docs: update example for using this in custom cypher (#176)
1 parent bab11aa commit c3d0284

File tree

1 file changed

+12
-16
lines changed
  • modules/ROOT/pages/type-definitions/directives

1 file changed

+12
-16
lines changed

modules/ROOT/pages/type-definitions/directives/cypher.adoc

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

@@ -234,4 +230,4 @@ type Mutation {
234230
columnName: "a"
235231
)
236232
}
237-
----
233+
----

0 commit comments

Comments
 (0)