From 014769294b1be00e81ddadaa920d2dcc8c5e0c0e Mon Sep 17 00:00:00 2001 From: Markus Padourek Date: Fri, 21 Oct 2016 09:45:55 +0100 Subject: [PATCH] Override instance get_type on scalar instantiation for backwards-compativbility --- graphene/types/scalars.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphene/types/scalars.py b/graphene/types/scalars.py index a9b5b7af..d30d92b4 100644 --- a/graphene/types/scalars.py +++ b/graphene/types/scalars.py @@ -37,10 +37,16 @@ class Scalar(six.with_metaclass(ScalarTypeMeta, UnmountedType)): used to parse input from ast or variables and to ensure validity. ''' + def __init__(self): + def get_type(self): + return self + self.get_type = types.MethodType(get_type, self) + serialize = None parse_value = None parse_literal = None + @classmethod def get_type(self): return self