Skip to content

Commit

Permalink
retire BuildExecutionContextArgs
Browse files Browse the repository at this point in the history
in favor of union of ExecutionArgs & SubscriptionArgs
  • Loading branch information
yaacovCR committed Jun 21, 2021
1 parent cffc71e commit bcf5a72
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/execution/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,11 @@ import type {
ExecutionContext,
ExecutionResult,
} from './execute';
import type { SubscriptionArgs } from './subscribe';
import { getVariableValues, getArgumentValues } from './values';
import { collectFields } from './collectFields';
import { mapAsyncIterator } from './mapAsyncIterator';

export interface BuildExecutionContextArgs extends ExecutionArgs {
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
}

/**
* This class is exported only to assist people in implementing their own executors
* without duplicating too much code and should be used only as last resort for cases
Expand Down Expand Up @@ -101,7 +98,9 @@ export class Executor {
protected _errors: Array<GraphQLError>;

constructor(
argsOrExecutionContext: BuildExecutionContextArgs | ExecutionContext,
argsOrExecutionContext:
| (ExecutionArgs & SubscriptionArgs)
| ExecutionContext,
) {
const executionContext =
'fragments' in argsOrExecutionContext
Expand Down Expand Up @@ -142,7 +141,7 @@ export class Executor {
* @internal
*/
static buildExecutionContext(
args: BuildExecutionContextArgs,
args: ExecutionArgs & SubscriptionArgs,
): ExecutionContext {
const {
schema,
Expand Down

0 comments on commit bcf5a72

Please sign in to comment.