From e7391937dd39f0a7f105e5814476bec4c91e0716 Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Fri, 10 Nov 2017 21:49:48 +0000 Subject: [PATCH] fixes #322, fixed incorrect serializer instance usage --- graphene_django/rest_framework/mutation.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graphene_django/rest_framework/mutation.py b/graphene_django/rest_framework/mutation.py index 94d1e4b..58c6b9c 100644 --- a/graphene_django/rest_framework/mutation.py +++ b/graphene_django/rest_framework/mutation.py @@ -84,4 +84,9 @@ class SerializerMutation(ClientIDMutation): @classmethod def perform_mutate(cls, serializer, info): obj = serializer.save() - return cls(errors=None, **obj) + + kwargs = {} + for f, field in serializer.fields.items(): + kwargs[f] = field.get_attribute(obj) + + return cls(errors=None, **kwargs)