passing serialize/unserialize methods to EnumType

To fix the problem reported at https://github.com/graphql-python/graphene-sqlalchemy/issues/9.
This commit is contained in:
Philip Tzou 2016-10-10 11:41:01 -07:00
parent 5036d164b7
commit 921a5b9d5d

View File

@ -147,7 +147,11 @@ class TypeMap(GraphQLTypeMap):
graphene_type=type,
values=values,
name=type._meta.name,
description=type_description, )
description=type_description,
serialize=getattr(type, 'serialize', None),
parse_value=getattr(type, 'parse_value', None),
parse_literal=getattr(type, 'parse_literal', None),
)
def construct_objecttype(self, map, type):
if type._meta.name in map: