Skip to content

Commit 3e65a54

Browse files
committed
refactor: rename executeOperation to executeQueryOrMutationRootFields
...because that's what it does! The execution of an operation returns a map of data/errors, not just the data.
1 parent 0d297d9 commit 3e65a54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/execution/execute.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ function prepareContextAndRunFn<T>(
184184
return fn(exeContext);
185185
}
186186

187+
/**
188+
* Implements the "Executing operations" section of the spec for queries and mutations.
189+
*/
187190
function executeImpl(
188191
exeContext: ExecutionContext,
189192
): PromiseOrValue<ExecutionResult> {
@@ -199,7 +202,7 @@ function executeImpl(
199202
// at which point we still log the error and null the parent field, which
200203
// in this case is the entire response.
201204
try {
202-
const result = executeOperation(exeContext);
205+
const result = executeQueryOrMutationRootFields(exeContext);
203206
if (isPromise(result)) {
204207
return result.then(
205208
(data) => buildResponse(data, exeContext.errors),
@@ -343,10 +346,7 @@ function buildPerEventExecutionContext(
343346
};
344347
}
345348

346-
/**
347-
* Implements the "Executing operations" section of the spec.
348-
*/
349-
function executeOperation(
349+
function executeQueryOrMutationRootFields(
350350
exeContext: ExecutionContext,
351351
): PromiseOrValue<ObjMap<unknown>> {
352352
const { operation, schema, fragments, variableValues, rootValue } =

0 commit comments

Comments
 (0)