GraphQL over HTTP specification released
The GraphQL specification has been transport agnostic since 2015, so it does not define how requests and responses travel over the network. The new GraphQL over HTTP specification is a separate, supplementary document that covers URLs, GET and POST requests, JSON encoding, headers, and more.
It introduces the application/graphql-response+json media type[1], so clients can tell a GraphQL response from an error sent by a proxy or cache, whatever the status code. Previously most servers returned application/json, often with status 200 as a workaround. The general rule is that a request returning data gets a 2xx status code, and a request returning only errors gets a 4xx or 5xx code. The specification also adds the 294 Partial Success status code for responses that contain both data and errors.
The authors plan to support the QUERY HTTP verb in the next revision, after the IETF moved it to a proposed standard. They also want a standard approach to persisted queries[2], which are GraphQL documents stored in advance, to address performance, security, and observability. Request batching[3] is expected to help with composite schemas (Federation) and with schemas the client does not control. Most GraphQL frameworks and libraries already support the new specification.
Read the original graphql.orgDiscussion
Sources
-
GraphQL
Announcing the GraphQL over HTTP specification



