@@ -306,12 +306,12 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
306
306
sourceValue)}.
307
307
- If internal {error} was raised:
308
308
- Cancel {sourceStream}.
309
- - Complete { responseStream} with { error}.
309
+ - Perform {EmitErrorAndComplete( responseStream, error) }.
310
310
- Otherwise emit {response} on {responseStream}.
311
311
- When {sourceStream} completes normally:
312
312
- Complete {responseStream} normally.
313
313
- When {sourceStream} completes with {error}:
314
- - Complete { responseStream} with { error}.
314
+ - Perform {EmitErrorAndComplete( responseStream, error) }.
315
315
- When {responseStream} is cancelled:
316
316
- Cancel {sourceStream}.
317
317
- Complete {responseStream} normally.
@@ -337,6 +337,13 @@ ExecuteSubscriptionEvent(subscription, schema, variableValues, initialValue):
337
337
Note: The {ExecuteSubscriptionEvent()} algorithm is intentionally similar to
338
338
{ExecuteQuery()} since this is how each event result is produced.
339
339
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
+
340
347
#### Unsubscribe
341
348
342
349
Unsubscribe cancels the Response Stream when a client no longer wishes to
0 commit comments