Skip to content

Commit 4e0ed36

Browse files
committed
refactor: use spread syntax with exeContext
1 parent 3a2fc8b commit 4e0ed36

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/execution/execute.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ export function buildExecutionContext(
325325
function executeOperation(
326326
exeContext: ExecutionContext,
327327
): PromiseOrValue<ObjMap<unknown>> {
328-
const { operation } = exeContext;
329-
const rootType = exeContext.schema.getRootType(operation.operation);
328+
const { operation, schema, fragments, variableValues, rootValue } =
329+
exeContext;
330+
const rootType = schema.getRootType(operation.operation);
330331
if (rootType == null) {
331332
throw new GraphQLError(
332333
`Schema is not configured to execute ${operation.operation} operation.`,
@@ -335,16 +336,14 @@ function executeOperation(
335336
}
336337

337338
const rootFields = collectFields(
338-
exeContext.schema,
339-
exeContext.fragments,
340-
exeContext.variableValues,
339+
schema,
340+
fragments,
341+
variableValues,
341342
rootType,
342343
operation.selectionSet,
343344
);
344345
const path = undefined;
345346

346-
const { rootValue } = exeContext;
347-
348347
switch (operation.operation) {
349348
case OperationTypeNode.QUERY:
350349
return executeFields(exeContext, rootType, rootValue, path, rootFields);

0 commit comments

Comments
 (0)