Skip to content

Commit b4cf3c3

Browse files
committed
Minor simplification and clarification
Replicates graphql/graphql-js@7f5fe4d
1 parent 0da3225 commit b4cf3c3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/graphql/execution/execute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,8 @@ def execute_subscription(
14831483
root_type,
14841484
context.operation.selection_set,
14851485
)
1486-
response_name, field_nodes = next(iter(root_fields.items()))
1486+
first_root_field = next(iter(root_fields.items()))
1487+
response_name, field_nodes = first_root_field
14871488
field_name = field_nodes[0].name.value
14881489
field_def = schema.get_field(root_type, field_name)
14891490

src/graphql/validation/rules/single_field_subscriptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ def enter_operation_definition(
7070
)
7171
)
7272
for field_nodes in fields.values():
73-
field = field_nodes[0]
74-
field_name = field.name.value
73+
field_name = field_nodes[0].name.value
7574
if field_name.startswith("__"):
7675
self.report_error(
7776
GraphQLError(

0 commit comments

Comments
 (0)