Skip to content

Commit

Permalink
move guard to appropriate location (#103)
Browse files Browse the repository at this point in the history
guard only necessary for those using graphql-execute as drop-in replacement for graphql@15
  • Loading branch information
yaacovCR committed Dec 5, 2021
1 parent d5bb5e4 commit 719ef94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/execution/execute.ts
@@ -1,6 +1,7 @@
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
import { isPromise } from '../jsutils/isPromise';
import { isAsyncIterable } from '../jsutils/isAsyncIterable';
import { devAssert } from '../jsutils/devAssert';

import type {
ExecutionArgs,
Expand All @@ -24,6 +25,12 @@ export function execute(
): PromiseOrValue<
ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, void>
> {
// Temporary for v15 to v16 migration. Remove in v17
devAssert(
arguments.length < 2,
'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.',
);

const executor = new Executor();
return executor.execute(args);
}
Expand Down
6 changes: 0 additions & 6 deletions src/execution/executor.ts
Expand Up @@ -257,12 +257,6 @@ export class Executor {
): PromiseOrValue<
ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, void>
> {
// Temporary for v15 to v16 migration. Remove in v17
devAssert(
arguments.length < 2,
'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.',
);

const exeContext = this.buildExecutionContext(args);

// If a valid execution context cannot be created due to incorrect arguments,
Expand Down

0 comments on commit 719ef94

Please sign in to comment.