File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -481,7 +481,9 @@ def build_enum_value_map(
481
481
# Note: While this could make assertions to get the correctly typed
482
482
# value, that would throw immediately while type system validation
483
483
# with validate_schema() will produce more actionable results.
484
- enum_value_map [value .name .value ] = GraphQLEnumValue (
484
+ value_name = value .name .value
485
+ enum_value_map [value_name ] = GraphQLEnumValue (
486
+ value = value_name ,
485
487
description = value .description .value if value .description else None ,
486
488
deprecation_reason = get_deprecation_reason (value ),
487
489
ast_node = value ,
Original file line number Diff line number Diff line change 1
1
from collections import namedtuple
2
- from typing import Union
2
+ from typing import cast , Union
3
3
4
4
from pytest import raises # type: ignore
5
5
16
16
GraphQLInt ,
17
17
GraphQLString ,
18
18
GraphQLArgument ,
19
+ GraphQLEnumType ,
19
20
GraphQLEnumValue ,
20
21
GraphQLField ,
21
22
GraphQLInputField ,
@@ -403,6 +404,12 @@ def multiple_value_enum():
403
404
)
404
405
assert cycle_sdl (sdl ) == sdl
405
406
407
+ # check that the internal values are the same as the names
408
+ schema = build_schema (sdl )
409
+ enum_type = schema .get_type ("Hello" )
410
+ assert isinstance (enum_type , GraphQLEnumType )
411
+ assert [value .value for value in enum_type .values .values ()] == ["WO" , "RLD" ]
412
+
406
413
def empty_union ():
407
414
sdl = dedent (
408
415
"""
You can’t perform that action at this time.
0 commit comments