Skip to content

Commit

Permalink
Move deprecated SubscriptionArgs to 'src/subscription'
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Oct 11, 2021
1 parent 2aad6b4 commit 318b972
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
2 changes: 0 additions & 2 deletions src/execution/index.ts
Expand Up @@ -15,6 +15,4 @@ export type {

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

export type { SubscriptionArgs } from './subscribe';

export { getDirectiveValues } from './values';
12 changes: 1 addition & 11 deletions src/execution/subscribe.ts
Expand Up @@ -27,16 +27,6 @@ import {
} from './execute';
import { mapAsyncIterator } from './mapAsyncIterator';

/**
* @deprecated use ExecutionArgs instead. Will be removed in v17
*
* ExecutionArgs has been broadened to include all properties
* within SubscriptionArgs. The SubscriptionArgs type is retained
* for backwards compatibility.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SubscriptionArgs extends ExecutionArgs {}

/**
* Implements the "Subscribe" algorithm described in the GraphQL specification.
*
Expand All @@ -59,7 +49,7 @@ export interface SubscriptionArgs extends ExecutionArgs {}
* Accepts either an object with named arguments, or individual arguments.
*/
export async function subscribe(
args: SubscriptionArgs,
args: ExecutionArgs,
): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult> {
const {
schema,
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Expand Up @@ -320,9 +320,10 @@ export type {
ExecutionArgs,
ExecutionResult,
FormattedExecutionResult,
SubscriptionArgs,
} from './execution/index';

export type { SubscriptionArgs } from './subscription/index';

/** Validate GraphQL documents. */
export {
validate,
Expand Down
13 changes: 11 additions & 2 deletions src/subscription/index.ts
Expand Up @@ -9,6 +9,15 @@
* will be dropped entirely.
*/

export { subscribe, createSourceEventStream } from '../execution/subscribe';
import type { ExecutionArgs } from '../execution/subscribe';

/**
* @deprecated use ExecutionArgs instead. Will be removed in v17
*
* ExecutionArgs has been broadened to include all properties within SubscriptionArgs.
* The SubscriptionArgs type is retained for backwards compatibility.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SubscriptionArgs extends ExecutionArgs {}

export type { SubscriptionArgs } from '../execution/subscribe';
export { subscribe, createSourceEventStream } from '../execution/subscribe';

0 comments on commit 318b972

Please sign in to comment.