|
9 | 9 | GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType,
|
10 | 10 | GraphQLObjectType, GraphQLUnionType,
|
11 | 11 | is_enum_type, is_input_object_type, is_input_type, is_interface_type,
|
12 |
| - is_named_type, is_non_null_type, |
13 |
| - is_object_type, is_output_type, is_union_type) |
| 12 | + is_named_type, is_object_type, is_output_type, is_union_type, |
| 13 | + is_required_argument) |
14 | 14 | from ..utilities.assert_valid_name import is_valid_name_error
|
15 | 15 | from ..utilities.type_comparators import is_equal_type, is_type_sub_type_of
|
16 | 16 | from .directives import GraphQLDirective, is_directive
|
@@ -332,14 +332,12 @@ def validate_object_implements_interface(
|
332 | 332 | # Assert additional arguments must not be required.
|
333 | 333 | for arg_name, obj_arg in obj_field.args.items():
|
334 | 334 | iface_arg = iface_field.args.get(arg_name)
|
335 |
| - if not iface_arg and is_non_null_type(obj_arg.type): |
| 335 | + if not iface_arg and is_required_argument(obj_arg): |
336 | 336 | self.report_error(
|
337 |
| - 'Object field argument' |
338 |
| - f' {obj.name}.{field_name}({arg_name}:)' |
339 |
| - f' is of required type {obj_arg.type}' |
340 |
| - ' but is not also provided by the Interface field' |
341 |
| - f' {iface.name}.{field_name}.', |
342 |
| - [get_field_arg_type_node(obj, field_name, arg_name), |
| 337 | + f'Object field {obj.name}.{field_name} includes' |
| 338 | + f' required argument {arg_name} that is missing from' |
| 339 | + f' the Interface field {iface.name}.{field_name}.', |
| 340 | + [get_field_arg_node(obj, field_name, arg_name), |
343 | 341 | get_field_node(iface, field_name)])
|
344 | 342 |
|
345 | 343 | def validate_union_members(self, union: GraphQLUnionType):
|
|
0 commit comments