File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ def build_enum_def(enum_introspection: Dict) -> GraphQLEnumType:
175
175
description = enum_introspection .get ("description" ),
176
176
values = {
177
177
value_introspect ["name" ]: GraphQLEnumValue (
178
+ value = value_introspect ["name" ],
178
179
description = value_introspect .get ("description" ),
179
180
deprecation_reason = value_introspect .get ("deprecationReason" ),
180
181
)
Original file line number Diff line number Diff line change @@ -382,28 +382,29 @@ def builds_a_schema_with_an_enum():
382
382
# It's also an Enum type on the client.
383
383
client_food_enum = assert_enum_type (client_schema .get_type ("Food" ))
384
384
385
- # Client types do not get server-only values, so they are set to None
386
- # rather than using the integers defined in the "server" schema.
385
+ # Client types do not get server-only values, so they are set to the
386
+ # names of the enum values rather than using the integers defined in
387
+ # the "server" schema.
387
388
values = {
388
389
name : value .to_kwargs () for name , value in client_food_enum .values .items ()
389
390
}
390
391
assert values == {
391
392
"VEGETABLES" : {
392
- "value" : None ,
393
+ "value" : "VEGETABLES" ,
393
394
"description" : "Foods that are vegetables." ,
394
395
"deprecation_reason" : None ,
395
396
"extensions" : None ,
396
397
"ast_node" : None ,
397
398
},
398
399
"FRUITS" : {
399
- "value" : None ,
400
+ "value" : "FRUITS" ,
400
401
"description" : None ,
401
402
"deprecation_reason" : None ,
402
403
"extensions" : None ,
403
404
"ast_node" : None ,
404
405
},
405
406
"OILS" : {
406
- "value" : None ,
407
+ "value" : "OILS" ,
407
408
"description" : None ,
408
409
"deprecation_reason" : "Too fatty." ,
409
410
"extensions" : None ,
You can’t perform that action at this time.
0 commit comments