You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
You can look at it as the equivalent of POST request in REST
247
245
:marked
248
-
code-example(language="sh"class="code-shell").
246
+
code-example(language="json").
249
247
mutation {
250
-
addHero(heroName: "Russel Brand") {
248
+
addHero(heroName: "Russell Brand") {
251
249
id
252
250
name
253
251
}
254
252
}
255
-
age="html" format="linenums").
256
-
format="linenums" language="typescript").
257
-
format="linenums" language="js").
258
-
code-example(language="json").
259
253
:marked
260
254
GraphQL mutations consist of two parts:
261
255
1. The mutation name with arguments (`addHero`), which represents the actual operation to be done on the server (just like calling a function)
262
256
2. The fields you want back from the result of the mutation to update the client (`id` and `name`) - which is very powerful - You, as the client developer can
263
257
decide which fields you will get back, not something that the server will dictate for you
0 commit comments