Skip to content

Commit dabf869

Browse files
committed
refactor: execute_operation can take only one parameter
Replicates graphql/graphql-js@bde22d2
1 parent ffab536 commit dabf869

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/graphql/execution/execute.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,12 @@ def build_response(
331331
)
332332
return ExecutionResult(data, errors)
333333

334-
def execute_operation(
335-
self, operation: OperationDefinitionNode
336-
) -> AwaitableOrValue[Any]:
334+
def execute_operation(self) -> AwaitableOrValue[Any]:
337335
"""Execute an operation.
338336
339337
Implements the "Executing operations" section of the spec.
340338
"""
339+
operation = self.operation
341340
root_type = self.schema.get_root_type(operation.operation)
342341
if root_type is None:
343342
raise GraphQLError(
@@ -1035,8 +1034,7 @@ def execute(
10351034
errors = exe_context.errors
10361035
build_response = exe_context.build_response
10371036
try:
1038-
operation = exe_context.operation
1039-
result = exe_context.execute_operation(operation)
1037+
result = exe_context.execute_operation()
10401038

10411039
if exe_context.is_awaitable(result):
10421040
# noinspection PyShadowingNames

0 commit comments

Comments
 (0)