File tree Expand file tree Collapse file tree 3 files changed +18
-38
lines changed Expand file tree Collapse file tree 3 files changed +18
-38
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,13 @@ def run(schema: GraphQLSchema, config: dict):
94
94
schema = add_enum_filters (schema )
95
95
schema = add_scalar_filters (schema )
96
96
schema = add_type_filters (schema )
97
+
98
+ # remove field arguments for edges (should not be in the API schema)
99
+ schema = remove_field_arguments_for_types (schema )
100
+
97
101
if config .get ('generation' ).get ('query_type_filter' ):
98
102
schema = add_object_type_filters (schema )
103
+
99
104
if config .get ('generation' ).get ('query_list_of' ):
100
105
schema = add_list_of_types (schema )
101
106
schema = add_list_queries (schema )
Original file line number Diff line number Diff line change 1
- """This comment is bound to the next type"""
2
- interface Pet {
3
- """This comment is bound to the next field"""
4
- name : String !
5
- }
6
-
7
- type Toy {
8
- name : String
9
- }
10
-
11
- enum Type {
12
- K
13
- A
14
- C
15
- B
16
- }
17
-
18
- type Dog implements Pet {
19
- toys : [Toy ]
20
- name : String !
21
- race : Race
22
- b : String
23
- d : String
24
- a : String
25
- c : String
26
- }
27
-
28
- type Hero {
29
- pets : [Pet ]
30
- }
1
+ scalar Date
31
2
32
- enum Race {
33
- DOBBERMAN
34
- Affenpinscher
35
- Afghan_Hound
36
- Afghan_Shepherd
3
+ type Person {
4
+ marriedTo (since : Date ! ): Person
37
5
}
38
-
39
- scalar Date
Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ def add_type_filters(schema: GraphQLSchema):
411
411
return schema
412
412
413
413
414
- def add_object_type_filters (schema ):
414
+ def add_object_type_filters (schema : GraphQLSchema ):
415
415
for _type in schema .type_map .values ():
416
416
if not is_schema_defined_type (_type ):
417
417
continue
@@ -426,6 +426,15 @@ def add_object_type_filters(schema):
426
426
return schema
427
427
428
428
429
+ def remove_field_arguments_for_types (schema : GraphQLSchema ):
430
+ for _type in schema .type_map .values ():
431
+ if not is_schema_defined_type (_type ):
432
+ continue
433
+ for field_name , field in _type .fields .items ():
434
+ field .args = {}
435
+ return schema
436
+
437
+
429
438
def add_enum_filters (schema : GraphQLSchema ):
430
439
"""
431
440
Add filter inputs for enums (Hasura-style).
You can’t perform that action at this time.
0 commit comments