@@ -325,7 +325,7 @@ def execute_operation(
325
325
) -> Optional [AwaitableOrValue [Any ]]:
326
326
"""Execute an operation.
327
327
328
- Implements the "Evaluating operations" section of the spec.
328
+ Implements the "Executing operations" section of the spec.
329
329
"""
330
330
type_ = get_operation_root_type (self .schema , operation )
331
331
fields = self .collect_fields (type_ , operation .selection_set , {}, set ())
@@ -366,13 +366,14 @@ def execute_fields_serially(
366
366
) -> AwaitableOrValue [Dict [str , Any ]]:
367
367
"""Execute the given fields serially.
368
368
369
- Implements the "Evaluating selection sets" section of the spec for "write" mode.
369
+ Implements the "Executing selection sets" section of the spec
370
+ for fields that must be executed serially.
370
371
"""
371
372
results : AwaitableOrValue [Dict [str , Any ]] = {}
372
373
is_awaitable = self .is_awaitable
373
374
for response_name , field_nodes in fields .items ():
374
375
field_path = Path (path , response_name , parent_type .name )
375
- result = self .resolve_field (
376
+ result = self .execute_field (
376
377
parent_type , source_value , field_nodes , field_path
377
378
)
378
379
if result is Undefined :
@@ -425,15 +426,16 @@ def execute_fields(
425
426
) -> AwaitableOrValue [Dict [str , Any ]]:
426
427
"""Execute the given fields concurrently.
427
428
428
- Implements the "Evaluating selection sets" section of the spec for "read" mode.
429
+ Implements the "Executing selection sets" section of the spec
430
+ for fields that may be executed in parallel.
429
431
"""
430
432
results = {}
431
433
is_awaitable = self .is_awaitable
432
434
awaitable_fields : List [str ] = []
433
435
append_awaitable = awaitable_fields .append
434
436
for response_name , field_nodes in fields .items ():
435
437
field_path = Path (path , response_name , parent_type .name )
436
- result = self .resolve_field (
438
+ result = self .execute_field (
437
439
parent_type , source_value , field_nodes , field_path
438
440
)
439
441
if result is not Undefined :
@@ -577,7 +579,7 @@ def build_resolve_info(
577
579
self .is_awaitable ,
578
580
)
579
581
580
- def resolve_field (
582
+ def execute_field (
581
583
self ,
582
584
parent_type : GraphQLObjectType ,
583
585
source : Any ,
@@ -586,9 +588,11 @@ def resolve_field(
586
588
) -> AwaitableOrValue [Any ]:
587
589
"""Resolve the field on the given source object.
588
590
589
- In particular, this figures out the value that the field returns by calling its
590
- resolve function, then calls complete_value to await coroutine objects,
591
- serialize scalars, or execute the sub-selection-set for objects.
591
+ Implements the "Executing field" section of the spec.
592
+
593
+ In particular, this method figures out the value that the field returns by
594
+ calling its resolve function, then calls complete_value to await coroutine
595
+ objects, serialize scalars, or execute the sub-selection-set for objects.
592
596
"""
593
597
field_def = get_field_def (self .schema , parent_type , field_nodes [0 ])
594
598
if not field_def :
@@ -1060,7 +1064,7 @@ def execute(
1060
1064
) -> AwaitableOrValue [ExecutionResult ]:
1061
1065
"""Execute a GraphQL operation.
1062
1066
1063
- Implements the "Evaluating requests" section of the GraphQL specification.
1067
+ Implements the "Executing requests" section of the GraphQL specification.
1064
1068
1065
1069
Returns an ExecutionResult (if all encountered resolvers are synchronous),
1066
1070
or a coroutine object eventually yielding an ExecutionResult.
@@ -1125,7 +1129,7 @@ def execute_sync(
1125
1129
) -> ExecutionResult :
1126
1130
"""Execute a GraphQL operation synchronously.
1127
1131
1128
- Also implements the "Evaluating requests" section of the GraphQL specification.
1132
+ Also implements the "Executing requests" section of the GraphQL specification.
1129
1133
1130
1134
However, it guarantees to complete synchronously (or throw an error) assuming
1131
1135
that all field resolvers are also synchronous.
0 commit comments