Skip to content

Commit 91f2a5b

Browse files
committed
add fields for edges in inputs to update objects (closes #111)
1 parent 7b15760 commit 91f2a5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

graphql-api-generator/utils/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,11 @@ def add_input_update(schema: GraphQLSchema):
421421
if is_enum_or_scalar(inner_field_type):
422422
num_fields += 1
423423
make += f'extend input {update_name} {{ {field_name}: {f_type} }} \n'
424+
else:
425+
num_fields += 1
426+
connect_name = f'_InputToConnect{capitalize(field_name)}Of{_type.name}'
427+
connect = copy_wrapper_structure(schema.type_map[connect_name], f_type)
428+
make += f'extend input {update_name} {{ {field_name}: {connect} }} \n'
424429

425430
if num_fields == 0:
426431
make += f'extend input {update_name} {{ _dummy: String }} \n'

0 commit comments

Comments
 (0)