Skip to content

Commit 5257c92

Browse files
committed
Don't use a new algorithm, no need to DRY
1 parent 2ef903c commit 5257c92

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

spec/Section 6 -- Execution.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,18 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
306306
sourceValue)}.
307307
- If internal {error} was raised:
308308
- Cancel {sourceStream}.
309-
- Perform {EmitErrorAndComplete(responseStream, error)}.
309+
- Let {errors} be a list containing {error}.
310+
- Let {response} be an unordered map containing {errors}.
311+
- Emit {response} on {responseStream}.
312+
- Complete {responseStream} normally.
310313
- Otherwise emit {response} on {responseStream}.
311314
- When {sourceStream} completes normally:
312315
- Complete {responseStream} normally.
313316
- When {sourceStream} completes with {error}:
314-
- Perform {EmitErrorAndComplete(responseStream, error)}.
317+
- Let {errors} be a list containing {error}.
318+
- Let {response} be an unordered map containing {errors}.
319+
- Emit {response} on {responseStream}.
320+
- Complete {responseStream} normally.
315321
- When {responseStream} is cancelled:
316322
- Cancel {sourceStream}.
317323
- Complete {responseStream} normally.
@@ -337,13 +343,6 @@ ExecuteSubscriptionEvent(subscription, schema, variableValues, initialValue):
337343
Note: The {ExecuteSubscriptionEvent()} algorithm is intentionally similar to
338344
{ExecuteQuery()} since this is how each event result is produced.
339345

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-
347346
#### Unsubscribe
348347

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

0 commit comments

Comments
 (0)