Skip to content

Move deprecated SubscriptionArgs to 'src/subscription' #3309

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

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move deprecated SubscriptionArgs to 'src/subscription'
  • Loading branch information
IvanGoncharov committed Oct 11, 2021
commit a134059df23691d3434e0663ce20ae41934fc161
2 changes: 0 additions & 2 deletions src/execution/index.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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';