Skip to content

Commit 148699f

Browse files
author
igor.luckenkov
committed
Throw an error if client provides abort signal for subscriptions
1 parent 0a8f4f8 commit 148699f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/execution/execute.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,14 @@ export function experimentalSubscribeIncrementally(
16611661
>
16621662
| ExecutionResult
16631663
> {
1664+
// Until we have execution cancelling support in Subscriptions,
1665+
// throw an error if client provides abort signal.
1666+
if (args.signal) {
1667+
return {
1668+
errors: [new GraphQLError('Subscriptions do not support abort signals.')],
1669+
};
1670+
}
1671+
16641672
// If a valid execution context cannot be created due to incorrect arguments,
16651673
// a "Response" with only errors is returned.
16661674
const exeContext = buildExecutionContext(args);

0 commit comments

Comments
 (0)