Skip to content

Commit d312e43

Browse files
authored
Incremental Delivery over HTTP/2 (#252)
1 parent ba42f7f commit d312e43

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

rfcs/IncrementalDelivery.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ This RFC proposes adding a specification of how "Incremental" GraphQL results sh
66

77
An Incremental result is a GraphQL result that is split up into multiple payloads, allowing clients quicker access to parts of the results. Currently this is supported by the proposed `@defer` and `@stream` directives ([RFC](https://github.com/graphql/graphql-spec/blob/master/rfcs/DeferStream.md)).
88

9-
## `transfer-encoding: chunked`
9+
### HTTP/1.1
1010

11-
The HTTP response for an incrementally delivered response should contain the `transfer-encoding: chunked` response header. Chunked transfer encoding allows the body of the response to be delivered as a series of chunks, allowing clients to read each chunk of the response as it is sent without waiting for the entire response.
11+
An incrementally delivered response should contain the `Transfer-Encoding: chunked` response header when using HTTP/1.1. Chunked transfer encoding allows the body of the response to be delivered as a series of chunks, allowing clients to read each chunk of the response as it is sent without waiting for the entire response.
1212

13-
## `content-type: multipart/mixed`
13+
### HTTP/2
14+
15+
Because of improved data streaming mechanisms, HTTP/2 prohibits the use of the `Transfer-Encoding` header. It is very likely that compliant servers will treat requests containing the header as malformed ([see section 8.2.2. Connection-Specific Header Fields in HTTP/2 spec](https://datatracker.ietf.org/doc/html/rfc9113#section-8.1)).
16+
17+
Compliant servers must follow the HTTP/2 specification and not set the `Transfer-Encoding` header.
18+
19+
## `Content-Type: multipart/mixed`
1420

1521
The HTTP response for an incrementally delivered response should conform to the [specification of multipart content defined by the W3 in rfc1341](https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html). The HTTP response must contain the `Content-Type` response header with a specified boundary, for example `Content-Type: multipart/mixed; boundary="-"`. A simple boundary of `-` can be used as there is no possiblity of conflict with JSON data. However, any arbitrary boundary may be used.
1622

0 commit comments

Comments
 (0)