This commit is contained in:
ksonj 2018-02-21 15:11:42 +00:00 committed by GitHub
commit f1494d93d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,11 @@
from .enum import PyEnum
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):