Skip to content

Commit bd73639

Browse files
vaheSashko Stubailo
authored and
Sashko Stubailo
committed
Updated Mutations section of Learn Queries (graphql#109)
Updated text to reflect changes in graphql mutation schema: removal of `incrementCredits`, addition of `createReview`.
1 parent f168e54 commit bd73639

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/learn/Learn-Queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ mutation CreateReviewForEpisode($ep: Episode!, $review: ReviewInput!) {
218218
}
219219
```
220220

221-
In this case, the `incrementCredits` mutation field returns a `Human` object, so we can query the new value of `totalCredits` after giving that character some more credits. Otherwise, we would have needed to send two requests - one to update the credits, and another to get the new value - or guess at the new amount based on outdated data.
221+
Note how `createReview` field returns the `stars` and `commentary` fields of the newly created review. This is especially useful when mutating existing data, for example, when incrementing a field, since we can mutate and query the new value of the field with one request.
222222

223223
You might also notice that, in this example, the `review` variable we passed in is not a scalar. It's an _input object type_, a special kind of object type that can be passed in as an argument. Learn more about input types on the Schema page.
224224

0 commit comments

Comments
 (0)