diff --git a/graphene_django/rest_framework/mutation.py b/graphene_django/rest_framework/mutation.py index 3009c06..f9b074d 100644 --- a/graphene_django/rest_framework/mutation.py +++ b/graphene_django/rest_framework/mutation.py @@ -137,5 +137,13 @@ class SerializerMutation(ClientIDMutation): @classmethod def perform_mutate(cls, serializer, info): obj = serializer.save() - kwargs = serializer.to_representation(obj) + + kwargs = {} + for f, field in serializer.fields.items(): + if not field.write_only: + if isinstance(field, serializers.SerializerMethodField): + kwargs[f] = field.to_representation(obj) + else: + kwargs[f] = field.get_attribute(obj) + return cls(errors=None, **kwargs)