Skip to content
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
4 changes: 4 additions & 0 deletions src/execution/index.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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';
import { mapAsyncIterator } from './mapAsyncIterator';

export interface SubscriptionArgs {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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';