Skip to content

Commit 290b0e2

Browse files
authored
Spec edits for multipart @defer @stream around content-length (#152)
* feat: Sprinkle spec edits * chore: mention start/end boundaries * chore: updates to be more conceise * chore: get that backtick in
1 parent f9420ca commit 290b0e2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

rfcs/IncrementalDelivery.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,20 @@ An example response body will look like:
1919
```
2020
---
2121
Content-Type: application/json; charset=utf-8
22-
Content-Length: 45
2322
2423
{"data":{"hello":"Hello Rob"},"hasNext":true}
25-
2624
---
2725
Content-Type: application/json; charset=utf-8
28-
Content-Length: 57
2926
3027
{"data":{"test":"Hello World"},"path":[],"hasNext":false}
31-
3228
-----
3329
```
3430
* The boundary used is `-` and is passed to the client in the http response's `Content-Type` header. Note that headers can appear in both the HTTP response itself and as part of the response body. The `Content-Type` header must be sent in the HTTP response.
35-
* Each part of the multipart response must start with `---` and a `CRLF`
31+
* An initial boundary is sent marking the end of the preamble area.
3632
* Each part of the multipart response must contain a `Content-Type` header. Similar to the GraphQL specification this specification does not require a specific serialization format. For consistency and ease of notation, examples of the response are given in JSON throughout the spec.
37-
* Each part of the multipart response must contain a `Content-Length` header. This should be the number of bytes of the payload of the response. It does not include the size of the headers, boundaries, or `CRLF`s used to separate the content.
3833
* After all headers, an additional `CRLF` is sent.
39-
* The payload is sent, followed by two `CRLF`s.
40-
* After the last part of the multipart response is sent, the terminating boundary `-----` is sent, followed by a `CRLF`
34+
* The payload is sent, followed by a `CRLF`.
35+
* After each payload, a boundary is sent. For the final payload, the terminating boundary of `-----` followed by a `CRLF` is sent. For all other payloads a boundary of `---` followed by a `CRFL` is sent.
4136

4237
## Server Implementations
4338
* `express-graphql`: [pull request](https://github.com/graphql/express-graphql/pull/583)

0 commit comments

Comments
 (0)