Skip to content

Commit 3a13fa0

Browse files
committed
small refactor extracted from #4309
1 parent dea74aa commit 3a13fa0

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
@@ -260,10 +260,13 @@ export function executeQueryOrMutationOrSubscriptionEvent(
260260
variableValues,
261261
hideSuggestions,
262262
} = validatedExecutionArgs;
263-
const rootType = schema.getRootType(operation.operation);
263+
264+
const { operation: operationType, selectionSet } = operation;
265+
266+
const rootType = schema.getRootType(operationType);
264267
if (rootType == null) {
265268
throw new GraphQLError(
266-
`Schema is not configured to execute ${operation.operation} operation.`,
269+
`Schema is not configured to execute ${operationType} operation.`,
267270
{ nodes: operation },
268271
);
269272
}
@@ -273,7 +276,7 @@ export function executeQueryOrMutationOrSubscriptionEvent(
273276
fragments,
274277
variableValues,
275278
rootType,
276-
operation.selectionSet,
279+
selectionSet,
277280
hideSuggestions,
278281
);
279282

0 commit comments

Comments
 (0)