Skip to content

Commit 732fcd2

Browse files
committed
small refactor extracted from #4309
1 parent 40fc2dd commit 732fcd2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/execution/execute.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,13 @@ export function executeQueryOrMutationOrSubscriptionEvent(
299299
variableValues,
300300
hideSuggestions,
301301
} = validatedExecutionArgs;
302-
const rootType = schema.getRootType(operation.operation);
302+
303+
const { operation: operationType, selectionSet } = operation;
304+
305+
const rootType = schema.getRootType(operationType);
303306
if (rootType == null) {
304307
throw new GraphQLError(
305-
`Schema is not configured to execute ${operation.operation} operation.`,
308+
`Schema is not configured to execute ${operationType} operation.`,
306309
{ nodes: operation },
307310
);
308311
}
@@ -312,7 +315,7 @@ export function executeQueryOrMutationOrSubscriptionEvent(
312315
fragments,
313316
variableValues,
314317
rootType,
315-
operation.selectionSet,
318+
selectionSet,
316319
hideSuggestions,
317320
);
318321

0 commit comments

Comments
 (0)