From 921a5b9d5d2e26cad6926701b0511829221e2a91 Mon Sep 17 00:00:00 2001 From: Philip Tzou Date: Mon, 10 Oct 2016 11:41:01 -0700 Subject: [PATCH] passing serialize/unserialize methods to EnumType To fix the problem reported at https://github.com/graphql-python/graphene-sqlalchemy/issues/9. --- graphene/types/typemap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/graphene/types/typemap.py b/graphene/types/typemap.py index d4a4d157..b40ea34e 100644 --- a/graphene/types/typemap.py +++ b/graphene/types/typemap.py @@ -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: