@@ -97,7 +97,8 @@ def get_object_type(type_ref):
97
97
98
98
def get_interface_type (type_ref ):
99
99
interface_type = get_type (type_ref )
100
- assert isinstance (interface_type , GraphQLInterfaceType ), 'Introspection must provide interface type for interfaces.'
100
+ assert isinstance (interface_type , GraphQLInterfaceType ), \
101
+ 'Introspection must provide interface type for interfaces.'
101
102
return interface_type
102
103
103
104
def build_type (type ):
@@ -158,8 +159,9 @@ def build_input_object_def(input_object_introspection):
158
159
return GraphQLInputObjectType (
159
160
name = input_object_introspection ['name' ],
160
161
description = input_object_introspection ['description' ],
161
- fields = lambda : build_input_value_def_map (input_object_introspection ['inputFields' ],
162
- GraphQLInputObjectField )
162
+ fields = lambda : build_input_value_def_map (
163
+ input_object_introspection ['inputFields' ], GraphQLInputObjectField
164
+ )
163
165
)
164
166
165
167
type_builders = {
@@ -177,7 +179,7 @@ def build_field_def_map(type_introspection):
177
179
type = get_output_type (f ['type' ]),
178
180
description = f ['description' ],
179
181
resolver = no_execution ,
180
- args = build_input_value_def_map (f ['args' ])))
182
+ args = build_input_value_def_map (f ['args' ], GraphQLArgument )))
181
183
for f in type_introspection ['fields' ]
182
184
])
183
185
@@ -188,7 +190,7 @@ def build_default_value(f):
188
190
189
191
return value_from_ast (parse_value (default_value ), get_input_type (f ['type' ]))
190
192
191
- def build_input_value_def_map (input_value_introspection , argument_type = GraphQLArgument ):
193
+ def build_input_value_def_map (input_value_introspection , argument_type ):
192
194
return OrderedDict ([
193
195
(f ['name' ], argument_type (
194
196
description = f ['description' ],
@@ -202,4 +204,5 @@ def build_input_value_def_map(input_value_introspection, argument_type=GraphQLAr
202
204
203
205
query_type = get_type (schema_introspection ['queryType' ])
204
206
mutation_type = get_type (schema_introspection ['mutationType' ]) if schema_introspection .get ('mutationType' ) else None
207
+
205
208
return GraphQLSchema (query_type , mutation_type )
0 commit comments