File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 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(
481481 # Note: While this could make assertions to get the correctly typed
482482 # value, that would throw immediately while type system validation
483483 # 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 ,
485487 description = value .description .value if value .description else None ,
486488 deprecation_reason = get_deprecation_reason (value ),
487489 ast_node = value ,
Original file line number Diff line number Diff line change 11from collections import namedtuple
2- from typing import Union
2+ from typing import cast , Union
33
44from pytest import raises # type: ignore
55
1616 GraphQLInt ,
1717 GraphQLString ,
1818 GraphQLArgument ,
19+ GraphQLEnumType ,
1920 GraphQLEnumValue ,
2021 GraphQLField ,
2122 GraphQLInputField ,
@@ -403,6 +404,12 @@ def multiple_value_enum():
403404 )
404405 assert cycle_sdl (sdl ) == sdl
405406
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+
406413 def empty_union ():
407414 sdl = dedent (
408415 """
You can’t perform that action at this time.
0 commit comments