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

Deprecate 'graphql/subscriptions' and move code to 'execution' #3292

Merged
merged 1 commit into from Oct 7, 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
4 changes: 4 additions & 0 deletions src/execution/index.ts
Expand Up @@ -13,4 +13,8 @@ export type {
FormattedExecutionResult,
} from './execute';

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

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

export { getDirectiveValues } from './values';
File renamed without changes.
19 changes: 9 additions & 10 deletions src/subscription/subscribe.ts → src/execution/subscribe.ts
Expand Up @@ -8,22 +8,21 @@ import { locatedError } from '../error/locatedError';

import type { DocumentNode } from '../language/ast';

import type { ExecutionResult, ExecutionContext } from '../execution/execute';
import { collectFields } from '../execution/collectFields';
import { getArgumentValues } from '../execution/values';
import type { GraphQLSchema } from '../type/schema';
import type { GraphQLFieldResolver } from '../type/definition';

import { getOperationRootType } from '../utilities/getOperationRootType';

import type { ExecutionResult, ExecutionContext } from './execute';
import { collectFields } from './collectFields';
import { getArgumentValues } from './values';
import {
assertValidExecutionArguments,
buildExecutionContext,
buildResolveInfo,
execute,
getFieldDef,
} from '../execution/execute';

import type { GraphQLSchema } from '../type/schema';
import type { GraphQLFieldResolver } from '../type/definition';

import { getOperationRootType } from '../utilities/getOperationRootType';

} from './execute';
IvanGoncharov marked this conversation as resolved.
Show resolved Hide resolved
import { mapAsyncIterator } from './mapAsyncIterator';

export interface SubscriptionArgs {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Expand Up @@ -312,17 +312,17 @@ export {
defaultTypeResolver,
responsePathAsArray,
getDirectiveValues,
subscribe,
createSourceEventStream,
} from './execution/index';

export type {
ExecutionArgs,
ExecutionResult,
FormattedExecutionResult,
SubscriptionArgs,
} from './execution/index';

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

/** Validate GraphQL documents. */
export {
validate,
Expand Down
2 changes: 2 additions & 0 deletions src/subscription/README.md
@@ -1,5 +1,7 @@
## GraphQL Subscription

NOTE: the `graphql/subscription` module has been deprecated with its exported functions integrated into the `graphql/execution` module, to better conform with the terminology of the GraphQL specification. For backwards compatibility, the `graphql/subscription` module currently re-exports the moved functions from the `graphql/execution` module. In the next major release, the `graphql/subscription` module will be dropped entirely.

The `graphql/subscription` module is responsible for subscribing to updates on specific data.

```js
Expand Down
16 changes: 14 additions & 2 deletions src/subscription/index.ts
@@ -1,2 +1,14 @@
export { subscribe, createSourceEventStream } from './subscribe';
export type { SubscriptionArgs } from './subscribe';
/**
* NOTE: the `graphql/subscription` module has been deprecated with its
* exported functions integrated into the `graphql/execution` module, to
* better conform with the terminology of the GraphQL specification.
*
* For backwards compatibility, the `graphql/subscription` module
* currently re-exports the moved functions from the `graphql/execution`
* module. In the next major release, the `graphql/subscription` module
* will be dropped entirely.
*/

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

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