-
Notifications
You must be signed in to change notification settings - Fork 15
Add an example for using input arguments with cypher #132
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
Changes from all commits
9c37f89
4c6ea19
c643292
b073c4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another point of confusion on my part: how does this query relate to the query above with the cypher directive in it?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this query we are passing a parameter called |
||
| 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" | ||
| ) | ||
| } | ||
| ---- | ||
| ---- | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the parameter
nameorvalue? i think i'm confusedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I'm trying to reference the parameter (
value) passed to the query (name).