mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 08:19:45 +03:00
Merge d58126facb
into 5df134e096
This commit is contained in:
commit
f1494d93d6
|
@ -1,5 +1,11 @@
|
||||||
|
from .enum import PyEnum
|
||||||
|
|
||||||
|
|
||||||
def attr_resolver(attname, default_value, root, info, **args):
|
def attr_resolver(attname, default_value, root, info, **args):
|
||||||
return getattr(root, attname, default_value)
|
value = getattr(root, attname, default_value)
|
||||||
|
if isinstance(value, PyEnum):
|
||||||
|
return value.value
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
def dict_resolver(attname, default_value, root, info, **args):
|
def dict_resolver(attname, default_value, root, info, **args):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user