Fix formatting and typo in MapSourceToResponseEvent#1070
Fix formatting and typo in MapSourceToResponseEvent#1070benjie wants to merge 5 commits intographql:mainfrom
MapSourceToResponseEvent#1070Conversation
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
If the line was originally supposed to refer to the source stream, or even if we are simply just changing it to refer to the source stream, we cannot say “when the source stream completes “, we have to say instead “if the source stream completes. “ |
|
I don't think it's necessary but nonetheless I've changed it to "if and when" to make clear both the conditional ("if") and timely ("when") elements. I'd argue |
2d1c477 to
8536e49
Compare
Based on #1069; that PR needs merging first (hence this is marked as a draft). If reviewing this, just look at the final commit only.
Lee did an editorial edit to the subscriptions PR ("Spec: Formal Subscriptions Definition") before merging, and added a line (in this commit) to
MapSourceToResponseEvent:MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues): * Return a new event stream {responseStream} which yields events as follows: * For each {event} on {sourceStream}: * Let {response} be the result of running {ExecuteSubscriptionEvent(subscription, schema, variableValues, event)}. * Yield an event containing {response}. + * When {responseStream} completes: complete this event stream.The "this event stream" is unclear; I would expect it to refer to
responseStream(the stream that we've created) butWhen {responseStream} completes: complete {responseStream}.doesn't make sense.I figured that it might be a deliberate way of saying that {sourceStream} should be closed if {responseStream} completes, however that's already handled in the Unsubscribe algorithm text:
Note "This may in turn also cancel the Source Stream." - i.e. may, we are not enforcing this. So
MapSourceToResponseEventshould not enforce it.I believe this was a simple typo, and should have been
When {sourceStream} completes: complete {responseStream}.so I have made this edit.Also, we now enforce consistent formatting in the spec (via #1069), so algorithm steps after a
:should be indented; I've fixed this also.