From e484bbc32e67046d4e60ffcfa21cc283d263177a Mon Sep 17 00:00:00 2001 From: Marais Rossouw Date: Wed, 18 Nov 2020 11:13:09 +1000 Subject: [PATCH 1/4] feat: Sprinkle spec edits --- rfcs/IncrementalDelivery.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rfcs/IncrementalDelivery.md b/rfcs/IncrementalDelivery.md index 98ca5391..ec3abc24 100644 --- a/rfcs/IncrementalDelivery.md +++ b/rfcs/IncrementalDelivery.md @@ -19,24 +19,18 @@ An example response body will look like: ``` --- Content-Type: application/json; charset=utf-8 -Content-Length: 45 {"data":{"hello":"Hello Rob"},"hasNext":true} - --- Content-Type: application/json; charset=utf-8 -Content-Length: 57 {"data":{"test":"Hello World"},"path":[],"hasNext":false} - ----- ``` * 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. * Each part of the multipart response must start with `---` and a `CRLF` * 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. -* 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. * After all headers, an additional `CRLF` is sent. -* The payload is sent, followed by two `CRLF`s. * After the last part of the multipart response is sent, the terminating boundary `-----` is sent, followed by a `CRLF` ## Server Implementations From 3c629b368bbf03b045a76efe02d66cdb3e5c1f72 Mon Sep 17 00:00:00 2001 From: Marais Rossouw Date: Wed, 18 Nov 2020 11:38:51 +1000 Subject: [PATCH 2/4] chore: mention start/end boundaries --- rfcs/IncrementalDelivery.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rfcs/IncrementalDelivery.md b/rfcs/IncrementalDelivery.md index ec3abc24..1cc60c6e 100644 --- a/rfcs/IncrementalDelivery.md +++ b/rfcs/IncrementalDelivery.md @@ -28,10 +28,11 @@ Content-Type: application/json; charset=utf-8 ----- ``` * 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. -* Each part of the multipart response must start with `---` and a `CRLF` +* An initial boundary is sent marking the end of the preamble area. +* Each part of the multipart response must end with `---` and wrapped with `CRLF`, meaning the boundary occupy it's own line. * 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. * After all headers, an additional `CRLF` is sent. -* After the last part of the multipart response is sent, the terminating boundary `-----` is sent, followed by a `CRLF` +* The last part of the multipart response, a terminating boundary `-----` is sent (inistead of a boundary), followed by a `CRLF` ## Server Implementations * `express-graphql`: [pull request](https://github.com/graphql/express-graphql/pull/583) From a28cb45e1bfcbd0fdbd768955f25f6e6ca682984 Mon Sep 17 00:00:00 2001 From: Marais Rossouw Date: Wed, 18 Nov 2020 12:01:36 +1000 Subject: [PATCH 3/4] chore: updates to be more conceise --- rfcs/IncrementalDelivery.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rfcs/IncrementalDelivery.md b/rfcs/IncrementalDelivery.md index 1cc60c6e..99875f63 100644 --- a/rfcs/IncrementalDelivery.md +++ b/rfcs/IncrementalDelivery.md @@ -27,12 +27,12 @@ Content-Type: application/json; charset=utf-8 {"data":{"test":"Hello World"},"path":[],"hasNext":false} ----- ``` -* 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. +* 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. * An initial boundary is sent marking the end of the preamble area. -* Each part of the multipart response must end with `---` and wrapped with `CRLF`, meaning the boundary occupy it's own line. * 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. * After all headers, an additional `CRLF` is sent. -* The last part of the multipart response, a terminating boundary `-----` is sent (inistead of a boundary), followed by a `CRLF` +* The payload is sent, followed by a `CRLF`. +* 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. ## Server Implementations * `express-graphql`: [pull request](https://github.com/graphql/express-graphql/pull/583) From 2f7937a9d83edce9c5b5fcc690e177c0630dae86 Mon Sep 17 00:00:00 2001 From: Marais Rossouw Date: Wed, 18 Nov 2020 12:08:49 +1000 Subject: [PATCH 4/4] chore: get that backtick in --- rfcs/IncrementalDelivery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/IncrementalDelivery.md b/rfcs/IncrementalDelivery.md index 99875f63..c5abe475 100644 --- a/rfcs/IncrementalDelivery.md +++ b/rfcs/IncrementalDelivery.md @@ -27,7 +27,7 @@ Content-Type: application/json; charset=utf-8 {"data":{"test":"Hello World"},"path":[],"hasNext":false} ----- ``` -* 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. +* 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. * An initial boundary is sent marking the end of the preamble area. * 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. * After all headers, an additional `CRLF` is sent.