Skip to content

Commit e8a2a74

Browse files
committed
apply review feedback
1 parent 4a8c0b5 commit e8a2a74

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/execution/__tests__/subscribe-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ describe('Subscription Initialization Phase', () => {
458458
'Must provide document.',
459459
);
460460

461+
// @ts-expect-error
461462
expect(() => createSourceEventStream(schema)).to.throw(
462463
'Must provide document.',
463464
);

src/execution/subscribe.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,26 @@ function mapSourceToResponse(
119119
* or otherwise separating these two steps. For more on this, see the
120120
* "Supporting Subscriptions at Scale" information in the GraphQL specification.
121121
*/
122+
export function createSourceEventStream(
123+
args: ExecutionArgs,
124+
): PromiseOrValue<AsyncIterable<unknown> | ExecutionResult>;
125+
/** @deprecated will be removed in next major version in favor of named arguments */
126+
export function createSourceEventStream(
127+
schema: GraphQLSchema,
128+
document: DocumentNode,
129+
rootValue?: unknown,
130+
contextValue?: unknown,
131+
variableValues?: Maybe<{ readonly [variable: string]: unknown }>,
132+
operationName?: Maybe<string>,
133+
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>,
134+
): PromiseOrValue<AsyncIterable<unknown> | ExecutionResult>;
122135
export function createSourceEventStream(
123136
argsOrSchema: ExecutionArgs | GraphQLSchema,
124-
/** Note: document argument is required if positional arguments are used */
125-
/** @deprecated will be removed in next major version in favor of named arguments */
126137
document?: DocumentNode,
127-
/** @deprecated will be removed in next major version in favor of named arguments */
128138
rootValue?: unknown,
129-
/** @deprecated will be removed in next major version in favor of named arguments */
130139
contextValue?: unknown,
131-
/** @deprecated will be removed in next major version in favor of named arguments */
132140
variableValues?: Maybe<{ readonly [variable: string]: unknown }>,
133-
/** @deprecated will be removed in next major version in favor of named arguments */
134141
operationName?: Maybe<string>,
135-
/** @deprecated will be removed in next major version in favor of named arguments */
136142
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>,
137143
): PromiseOrValue<AsyncIterable<unknown> | ExecutionResult> {
138144
if (isSchema(argsOrSchema)) {

0 commit comments

Comments
 (0)