Skip to content

Commit 62f2ac1

Browse files
authored
Move the "not mutation in GET request" above the examples (#378)
1 parent a92d2f4 commit 62f2ac1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

spec/GraphQLOverHTTP.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,12 @@ Note: By the above, `operationName=null` represents an operation with the name
302302
`"null"` (such as `query null { __typename }`). If a literal `null` is desired,
303303
either omit {operationName} or set it to the empty string.
304304

305+
GET requests MUST NOT be used for executing mutation operations. If the values
306+
of {query} and {operationName} indicate that a mutation operation is to be
307+
executed, the server MUST respond with error status code `405` (Method Not
308+
Allowed) and halt execution. This restriction is necessary to conform with the
309+
long-established semantics of safe methods within HTTP.
310+
305311
### Example
306312

307313
If we wanted to execute the following GraphQL query:
@@ -322,12 +328,6 @@ This request could be sent via an HTTP GET as follows:
322328
http://example.com/graphql?query=query(%24id%3A%20ID!)%7Buser(id%3A%24id)%7Bname%7D%7D&variables=%7B%22id%22%3A%22QVBJcy5ndXJ1%22%7D
323329
```
324330

325-
GET requests MUST NOT be used for executing mutation operations. If the values
326-
of {query} and {operationName} indicate that a mutation operation is to be
327-
executed, the server MUST respond with error status code `405` (Method Not
328-
Allowed) and halt execution. This restriction is necessary to conform with the
329-
long-established semantics of safe methods within HTTP.
330-
331331
## POST
332332

333333
A GraphQL POST request instructs the server to perform a query or mutation

0 commit comments

Comments
 (0)