Skip to content

Commit fc39b3d

Browse files
committed
Minor alignment with upstream
Replicates graphql/graphql-js@126b572 and graphql/graphql-js@ded3859
1 parent d9aae01 commit fc39b3d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

graphql/utilities/extend_schema.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,14 @@ def extend_input_object_type(
198198
)
199199

200200
def extend_input_field_map(type_: GraphQLInputObjectType) -> GraphQLInputFieldMap:
201-
old_field_map = type_.fields
202201
new_field_map = {
203202
field_name: GraphQLInputField(
204203
cast(GraphQLInputType, extend_type(field.type)),
205204
description=field.description,
206205
default_value=field.default_value,
207206
ast_node=field.ast_node,
208207
)
209-
for field_name, field in old_field_map.items()
208+
for field_name, field in type_.fields.items()
210209
}
211210

212211
# If there are any extensions to the fields, apply those here.
@@ -397,7 +396,6 @@ def extend_implemented_interfaces(
397396
def extend_field_map(
398397
type_: Union[GraphQLObjectType, GraphQLInterfaceType]
399398
) -> GraphQLFieldMap:
400-
old_field_map = type_.fields
401399
new_field_map = {
402400
field_name: GraphQLField(
403401
cast(GraphQLObjectType, extend_type(field.type)),
@@ -407,7 +405,7 @@ def extend_field_map(
407405
ast_node=field.ast_node,
408406
resolve=field.resolve,
409407
)
410-
for field_name, field in old_field_map.items()
408+
for field_name, field in type_.fields.items()
411409
}
412410

413411
# If there are any extensions to the fields, apply those here.

graphql/validation/rules/values_of_correct_type.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ def enter_object_value(self, node: ObjectValueNode, *_args):
8787
self.is_valid_scalar(node)
8888
return self.SKIP # Don't traverse further.
8989
# Ensure every required field exists.
90-
input_fields = type_.fields
9190
field_node_map = {field.name.value: field for field in node.fields}
92-
for field_name, field_def in input_fields.items():
91+
for field_name, field_def in type_.fields.items():
9392
field_node = field_node_map.get(field_name)
9493
if not field_node and is_required_input_field(field_def):
9594
field_type = field_def.type

0 commit comments

Comments
 (0)