Skip to content

Commit 0971dbb

Browse files
committed
Clean up build_client_schema source.
1 parent fefd4b5 commit 0971dbb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

graphql/core/utils/build_client_schema.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def get_object_type(type_ref):
9797

9898
def get_interface_type(type_ref):
9999
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.'
101102
return interface_type
102103

103104
def build_type(type):
@@ -158,8 +159,9 @@ def build_input_object_def(input_object_introspection):
158159
return GraphQLInputObjectType(
159160
name=input_object_introspection['name'],
160161
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+
)
163165
)
164166

165167
type_builders = {
@@ -177,7 +179,7 @@ def build_field_def_map(type_introspection):
177179
type=get_output_type(f['type']),
178180
description=f['description'],
179181
resolver=no_execution,
180-
args=build_input_value_def_map(f['args'])))
182+
args=build_input_value_def_map(f['args'], GraphQLArgument)))
181183
for f in type_introspection['fields']
182184
])
183185

@@ -188,7 +190,7 @@ def build_default_value(f):
188190

189191
return value_from_ast(parse_value(default_value), get_input_type(f['type']))
190192

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):
192194
return OrderedDict([
193195
(f['name'], argument_type(
194196
description=f['description'],
@@ -202,4 +204,5 @@ def build_input_value_def_map(input_value_introspection, argument_type=GraphQLAr
202204

203205
query_type = get_type(schema_introspection['queryType'])
204206
mutation_type = get_type(schema_introspection['mutationType']) if schema_introspection.get('mutationType') else None
207+
205208
return GraphQLSchema(query_type, mutation_type)

0 commit comments

Comments
 (0)