-
Notifications
You must be signed in to change notification settings - Fork 15
Mutation pages updates #185
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 4 commits
7f92ef6
d82ed18
a6b4730
e1ad19f
a54e2f5
2050e5d
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 |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
|
|
||
| = `delete` | ||
|
|
||
| Using these type definitions: | ||
| Consider these type definitions: | ||
|
|
||
| [source, graphql, indent=0] | ||
| ---- | ||
|
|
@@ -21,7 +21,7 @@ type User { | |
| } | ||
| ---- | ||
|
|
||
| These `delete` mutations and response types should be generated: | ||
| The following `delete` mutations and response types are generated: | ||
|
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. Is there a reason why the mutation is here written in lowercase? It could be helpful to find a rule for that, but I think generally we write clauses/operations in uppercase. 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. hm... on second thought, not so sure actually for mutations, it's used consistently as lower case actually (create, delete and update are all written like this) 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. Ah, whatever works best! I was just wondering because there are some cases where they are written in uppercase. |
||
|
|
||
| [source, graphql, indent=0] | ||
| ---- | ||
|
|
@@ -43,7 +43,7 @@ The `DeleteInfo` type is the common return type for all delete mutations. | |
|
|
||
| == Single `delete` | ||
|
|
||
| A single post can be deleted by executing the following GraphQL statement: | ||
| You can delete a single post by executing the following GraphQL statement: | ||
|
|
||
| [source, graphql, indent=0] | ||
| ---- | ||
|
|
@@ -57,12 +57,12 @@ mutation { | |
| } | ||
| ---- | ||
|
|
||
| This should delete the post using the autogenerated ID that was returned after that post's creation. | ||
| Consequently, `nodesDeleted` should be equal `1` (the post) and `relationshipsDeleted` should also equal `1` as the `HAS_POST` relationship between the `Post` and its author was deleted. | ||
| This deletes the post using the autogenerated ID that was returned after the creation of the post. | ||
| Consequently, `nodesDeleted` is equal to `1` (the post) and `relationshipsDeleted` is also equal to `1` as the `HAS_POST` relationship between the `Post` and its author was deleted. | ||
|
|
||
| == Nested `delete` | ||
|
|
||
| In case you want to delete a `User` *and* all of their posts, you can use a single nested `delete` mutation: | ||
| In case you want to delete a `User` and all of their posts, you can use a single nested `delete` mutation: | ||
lidiazuin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [source, graphql, indent=0] | ||
| ---- | ||
|
|
@@ -74,8 +74,7 @@ mutation { | |
| } | ||
| ---- | ||
|
|
||
| By the time the traversal has reached it, that empty `where` argument has the context of only refer to posts that were created by Jane Doe, as the traversals to those `Post` nodes were from her `User` node. | ||
| Essentially, the above query is equivalent to: | ||
| This query is equivalent to: | ||
|
|
||
| [source, graphql, indent=0] | ||
| ---- | ||
|
|
@@ -104,10 +103,12 @@ mutation { | |
|
|
||
| Note that the output Cypher statement should also have a redundant `WHERE` clause: | ||
|
|
||
| // ! | ||
| //Please add the cypher statement: | ||
|
|
||
| //[source, cypher, indent=0] | ||
| //---- | ||
| //DELETE User (name:"Jane Doe") | ||
| //WHERE Posts - | ||
| //---- | ||
| // ! | ||
Uh oh!
There was an error while loading. Please reload this page.