Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move deprecated SubscriptionArgs to 'src/subscription' #3309

Merged
merged 1 commit into from Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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/execute';

/**
* @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';