@@ -110,8 +110,8 @@ def get_node(global_id, _info):
110
110
111
111
def get_node_type (obj , _info , _type ):
112
112
if isinstance (obj , Faction ):
113
- return factionType
114
- return shipType
113
+ return faction_type
114
+ return ship_type
115
115
116
116
117
117
node_interface , node_field = node_definitions (get_node , get_node_type )[:2 ]
@@ -124,7 +124,7 @@ def get_node_type(obj, _info, _type):
124
124
# id: String!
125
125
# name: String
126
126
# }
127
- shipType = GraphQLObjectType (
127
+ ship_type = GraphQLObjectType (
128
128
name = "Ship" ,
129
129
description = "A ship in the Star Wars saga" ,
130
130
fields = lambda : {
@@ -148,7 +148,7 @@ def get_node_type(obj, _info, _type):
148
148
# cursor: String!
149
149
# node: Ship
150
150
# }
151
- ship_edge , ship_connection = connection_definitions (shipType , "Ship" )
151
+ ship_edge , ship_connection = connection_definitions (ship_type , "Ship" )
152
152
153
153
# We define our faction type, which implements the node interface.
154
154
#
@@ -158,7 +158,7 @@ def get_node_type(obj, _info, _type):
158
158
# name: String
159
159
# ships: ShipConnection
160
160
# }
161
- factionType = GraphQLObjectType (
161
+ faction_type = GraphQLObjectType (
162
162
name = "Faction" ,
163
163
description = "A faction in the Star Wars saga" ,
164
164
fields = lambda : {
@@ -185,11 +185,11 @@ def get_node_type(obj, _info, _type):
185
185
# empire: Faction
186
186
# node(id: String!): Node
187
187
# }
188
- queryType = GraphQLObjectType (
188
+ query_type = GraphQLObjectType (
189
189
name = "Query" ,
190
190
fields = lambda : {
191
- "rebels" : GraphQLField (factionType , resolve = lambda _obj , _info : get_rebels ()),
192
- "empire" : GraphQLField (factionType , resolve = lambda _obj , _info : get_empire ()),
191
+ "rebels" : GraphQLField (faction_type , resolve = lambda _obj , _info : get_rebels ()),
192
+ "empire" : GraphQLField (faction_type , resolve = lambda _obj , _info : get_empire ()),
193
193
"node" : node_field ,
194
194
},
195
195
)
@@ -226,18 +226,18 @@ def mutate_and_get_payload(_info, shipName, factionId, **_input):
226
226
return IntroduceShipMutation (shipId = new_ship .id , factionId = factionId )
227
227
228
228
229
- shipMutation = mutation_with_client_mutation_id (
229
+ ship_mutation = mutation_with_client_mutation_id (
230
230
"IntroduceShip" ,
231
231
input_fields = {
232
232
"shipName" : GraphQLInputField (GraphQLNonNull (GraphQLString )),
233
233
"factionId" : GraphQLInputField (GraphQLNonNull (GraphQLID )),
234
234
},
235
235
output_fields = {
236
236
"ship" : GraphQLField (
237
- shipType , resolve = lambda payload , _info : get_ship (payload .shipId )
237
+ ship_type , resolve = lambda payload , _info : get_ship (payload .shipId )
238
238
),
239
239
"faction" : GraphQLField (
240
- factionType , resolve = lambda payload , _info : get_faction (payload .factionId )
240
+ faction_type , resolve = lambda payload , _info : get_faction (payload .factionId )
241
241
),
242
242
},
243
243
mutate_and_get_payload = mutate_and_get_payload ,
@@ -250,10 +250,10 @@ def mutate_and_get_payload(_info, shipName, factionId, **_input):
250
250
# type Mutation {
251
251
# introduceShip(input IntroduceShipInput!): IntroduceShipPayload
252
252
# }
253
- mutationType = GraphQLObjectType (
254
- "Mutation" , fields = lambda : {"introduceShip" : shipMutation }
253
+ mutation_type = GraphQLObjectType (
254
+ "Mutation" , fields = lambda : {"introduceShip" : ship_mutation }
255
255
)
256
256
257
257
# Finally, we construct our schema (whose starting query type is the query
258
258
# type we defined above) and export it.
259
- StarWarsSchema = GraphQLSchema (query = queryType , mutation = mutationType )
259
+ star_wars_schema = GraphQLSchema (query = query_type , mutation = mutation_type )
0 commit comments