File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
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,28 @@ 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
385
+ # Client types do not get server-only values, so the values mirror the names,
386
386
# rather than using the integers defined in the "server" schema.
387
387
values = {
388
388
name : value .to_kwargs () for name , value in client_food_enum .values .items ()
389
389
}
390
390
assert values == {
391
391
"VEGETABLES" : {
392
- "value" : None ,
392
+ "value" : "VEGETABLES" ,
393
393
"description" : "Foods that are vegetables." ,
394
394
"deprecation_reason" : None ,
395
395
"extensions" : None ,
396
396
"ast_node" : None ,
397
397
},
398
398
"FRUITS" : {
399
- "value" : None ,
399
+ "value" : "FRUITS" ,
400
400
"description" : None ,
401
401
"deprecation_reason" : None ,
402
402
"extensions" : None ,
403
403
"ast_node" : None ,
404
404
},
405
405
"OILS" : {
406
- "value" : None ,
406
+ "value" : "OILS" ,
407
407
"description" : None ,
408
408
"deprecation_reason" : "Too fatty." ,
409
409
"extensions" : None ,
You can’t perform that action at this time.
0 commit comments