We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e2151f9 + 3efd6d1 commit 24687b6Copy full SHA for 24687b6
graphql/type/definition.py
@@ -4,6 +4,7 @@
4
from ..language import ast
5
from ..pyutils.cached_property import cached_property
6
from ..pyutils.ordereddict import OrderedDict
7
+from ..pyutils.compat import Enum as PyEnum
8
from ..utils.assert_valid_name import assert_valid_name
9
from ..utils.undefined import Undefined
10
@@ -516,9 +517,11 @@ def get_value(self, name):
516
517
518
def serialize(self, value):
519
# type: (str) -> Optional[str]
520
+ if isinstance(value, PyEnum):
521
+ # We handle PyEnum values
522
+ value = value.value
523
if isinstance(value, collections.Hashable):
524
enum_value = self._value_lookup.get(value)
-
525
if enum_value:
526
return enum_value.name
527
0 commit comments