@@ -403,19 +403,12 @@ def add_type_filters(schema: GraphQLSchema):
403
403
if is_list_type (field .type ):
404
404
continue
405
405
406
- < << << << HEAD
407
406
named_type = get_named_type (f_type )
408
407
if is_enum_or_scalar (f_type ):
409
408
make += f'{ field_name } : _{ named_type .name } Filter '
410
409
make += '} '
411
410
schema = add_to_schema (schema , make )
412
411
return schema
413
- == == == =
414
- # TODO check this!
415
- if is_list_type (f_type ):
416
- # Unknown how filters would apply for lists, skip.
417
- continue
418
- > >> >> >> e18b9f42c901bf9f4c1ef03764c4ccfab1f83b7d
419
412
420
413
421
414
def add_object_type_filters (schema ):
@@ -454,31 +447,27 @@ def add_enum_filters(schema: GraphQLSchema):
454
447
return schema
455
448
456
449
457
- < << << << HEAD
458
- def add_create_mutations (schema : GraphQLSchema ):
459
- == == == =
460
450
def add_filters_to_type_fields (_schema : GraphQLSchema ):
461
451
"""
462
452
Add filters as arguments to fields for object types.
463
453
:param _schema:
464
454
:return:
465
455
"""
466
456
for t in _schema .type_map .values ():
467
- if not is_schema_defined_object_type ( t ) or t . name . startswith ( '_' ):
457
+ if not is_schema_defined_type ( t ):
468
458
continue
469
459
470
460
# loop fields
471
461
for n , f in t .fields .items ():
472
462
field_type = get_named_type (f .type )
473
- if not is_schema_defined_object_type (field_type ) and not is_interface_type (field_type ):
463
+ if not is_schema_defined_type (field_type ) or is_interface_type (field_type ):
474
464
continue
475
465
_filter = _schema .type_map [f'_FilterFor{ field_type .name } ' ]
476
466
f .args ['filter' ] = GraphQLArgument (_filter )
477
467
return _schema
478
468
479
469
480
- def add_create_mutations (_schema ):
481
- > >> >> >> e18b9f42c901bf9f4c1ef03764c4ccfab1f83b7d
470
+ def add_create_mutations (schema ):
482
471
"""
483
472
Add mutations for creating object types.
484
473
:param schema:
0 commit comments