Skip to content

Commit 490d4e3

Browse files
Remove outdated implementation suggestions
* The `application/graphql` content-type is no longer recommended via the graphql-over-http spec * The graphql-over-http spec makes no recommendation of parsing the `query` query parameter for POST requests
1 parent 77c97c1 commit 490d4e3

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/content/learn/BestPractice-ServingOverHTTP.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ A standard GraphQL POST request should use the `application/json` content type,
5151

5252
`operationName` and `variables` are optional fields. `operationName` is only required if multiple operations are present in the query.
5353

54-
In addition to the above, we recommend supporting two additional cases:
55-
56-
* If the "query" query string parameter is present (as in the GET example above), it should be parsed and handled in the same way as the HTTP GET case.
57-
* If the "application/graphql" Content-Type header is present, treat the HTTP POST body contents as the GraphQL query string.
58-
59-
If you're using express-graphql, you already get these behaviors for free.
60-
6154
## Response
6255

6356
Regardless of the method by which the query and variables were sent, the response should be returned in the body of the request in JSON format. As mentioned in the spec, a query might result in some data and some errors, and those should be returned in a JSON object of the form:
@@ -87,4 +80,4 @@ If you are using NodeJS, we recommend looking at the [list of server implementat
8780

8881
## Draft Transport Specification
8982

90-
A detailed [HTTP & websockets transport specification](https://github.com/graphql/graphql-over-http) is in development. Though it is not yet finalized, these draft specifications act as a single source of truth for GraphQL client & library maintainers, detailing how to expose and consume a GraphQL API using an HTTP transport. Unlike the language specification, adherence is not mandatory, but most implementations are moving towards these standards to maximize interoperability.
83+
A detailed [HTTP & websockets transport specification](https://github.com/graphql/graphql-over-http) is in development. Though it is not yet finalized, these draft specifications act as a single source of truth for GraphQL client & library maintainers, detailing how to expose and consume a GraphQL API using an HTTP transport. Unlike the language specification, adherence is not mandatory, but most implementations are moving towards these standards to maximize interoperability.

0 commit comments

Comments
 (0)