Skip to content

Commit 3a2fc8b

Browse files
committed
refactor: executeOperation can take only one parameter
`operation` is included within `exeContext`
1 parent cfbc023 commit 3a2fc8b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/execution/execute.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult> {
186186
// at which point we still log the error and null the parent field, which
187187
// in this case is the entire response.
188188
try {
189-
const { operation } = exeContext;
190-
const result = executeOperation(exeContext, operation);
189+
const result = executeOperation(exeContext);
191190
if (isPromise(result)) {
192191
return result.then(
193192
(data) => buildResponse(data, exeContext.errors),
@@ -325,8 +324,8 @@ export function buildExecutionContext(
325324
*/
326325
function executeOperation(
327326
exeContext: ExecutionContext,
328-
operation: OperationDefinitionNode,
329327
): PromiseOrValue<ObjMap<unknown>> {
328+
const { operation } = exeContext;
330329
const rootType = exeContext.schema.getRootType(operation.operation);
331330
if (rootType == null) {
332331
throw new GraphQLError(

0 commit comments

Comments
 (0)