Skip to content

Commit 2ef903c

Browse files
committed
Don't complete with error.
1 parent 75f10e0 commit 2ef903c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spec/Section 6 -- Execution.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,12 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
306306
sourceValue)}.
307307
- If internal {error} was raised:
308308
- Cancel {sourceStream}.
309-
- Complete {responseStream} with {error}.
309+
- Perform {EmitErrorAndComplete(responseStream, error)}.
310310
- Otherwise emit {response} on {responseStream}.
311311
- When {sourceStream} completes normally:
312312
- Complete {responseStream} normally.
313313
- When {sourceStream} completes with {error}:
314-
- Complete {responseStream} with {error}.
314+
- Perform {EmitErrorAndComplete(responseStream, error)}.
315315
- When {responseStream} is cancelled:
316316
- Cancel {sourceStream}.
317317
- Complete {responseStream} normally.
@@ -337,6 +337,13 @@ ExecuteSubscriptionEvent(subscription, schema, variableValues, initialValue):
337337
Note: The {ExecuteSubscriptionEvent()} algorithm is intentionally similar to
338338
{ExecuteQuery()} since this is how each event result is produced.
339339

340+
EmitErrorAndComplete(responseStream, error):
341+
342+
- Let {errors} be a list containing {error}.
343+
- Let {response} be an unordered map containing {errors}.
344+
- Emit {response} on {responseStream}.
345+
- Complete {responseStream} normally.
346+
340347
#### Unsubscribe
341348

342349
Unsubscribe cancels the Response Stream when a client no longer wishes to

0 commit comments

Comments
 (0)