diff --git a/modules/ROOT/pages/type-definitions/directives/cypher.adoc b/modules/ROOT/pages/type-definitions/directives/cypher.adoc index 3001d36e..0510a21b 100644 --- a/modules/ROOT/pages/type-definitions/directives/cypher.adoc +++ b/modules/ROOT/pages/type-definitions/directives/cypher.adoc @@ -154,6 +154,26 @@ type Query { The downside of the latter approach is that you need to adjust the return object as you change your object type definition. +== Input arguments +The `@cypher` statement can access the query parameters by prepending `$` to the parameter name. For example: + +[source, graphql, indent=0] +---- +type Query { + name(value: String): String @cypher(statement: "RETURN $value AS res", columnName: "res") +} +---- + +The following GraphQL query returns the parameter `value`: + +[source, graphql, indent=0] +---- +query { + name(value: "Jane Smith") +} +---- + + == Usage examples The `@cypher` directive can be used in different contexts, such as the ones described in this section. @@ -234,4 +254,4 @@ type Mutation { columnName: "a" ) } ----- \ No newline at end of file +----