Skip to content

Commit f45bc0a

Browse files
Move deprecated SubscriptionArgs to 'src/subscription' (#3309)
1 parent 2aad6b4 commit f45bc0a

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

src/execution/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ export type {
1515

1616
export { subscribe, createSourceEventStream } from './subscribe';
1717

18-
export type { SubscriptionArgs } from './subscribe';
19-
2018
export { getDirectiveValues } from './values';

src/execution/subscribe.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ import {
2727
} from './execute';
2828
import { mapAsyncIterator } from './mapAsyncIterator';
2929

30-
/**
31-
* @deprecated use ExecutionArgs instead. Will be removed in v17
32-
*
33-
* ExecutionArgs has been broadened to include all properties
34-
* within SubscriptionArgs. The SubscriptionArgs type is retained
35-
* for backwards compatibility.
36-
*/
37-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
38-
export interface SubscriptionArgs extends ExecutionArgs {}
39-
4030
/**
4131
* Implements the "Subscribe" algorithm described in the GraphQL specification.
4232
*
@@ -59,7 +49,7 @@ export interface SubscriptionArgs extends ExecutionArgs {}
5949
* Accepts either an object with named arguments, or individual arguments.
6050
*/
6151
export async function subscribe(
62-
args: SubscriptionArgs,
52+
args: ExecutionArgs,
6353
): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult> {
6454
const {
6555
schema,

src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,10 @@ export type {
320320
ExecutionArgs,
321321
ExecutionResult,
322322
FormattedExecutionResult,
323-
SubscriptionArgs,
324323
} from './execution/index';
325324

325+
export type { SubscriptionArgs } from './subscription/index';
326+
326327
/** Validate GraphQL documents. */
327328
export {
328329
validate,

src/subscription/index.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
* will be dropped entirely.
1010
*/
1111

12-
export { subscribe, createSourceEventStream } from '../execution/subscribe';
12+
import type { ExecutionArgs } from '../execution/execute';
13+
14+
/**
15+
* @deprecated use ExecutionArgs instead. Will be removed in v17
16+
*
17+
* ExecutionArgs has been broadened to include all properties within SubscriptionArgs.
18+
* The SubscriptionArgs type is retained for backwards compatibility.
19+
*/
20+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
21+
export interface SubscriptionArgs extends ExecutionArgs {}
1322

14-
export type { SubscriptionArgs } from '../execution/subscribe';
23+
export { subscribe, createSourceEventStream } from '../execution/subscribe';

0 commit comments

Comments
 (0)