graphene-django-extras icon indicating copy to clipboard operation
graphene-django-extras copied to clipboard

[Improvement] Partial Update with serializer_class

Open yannRavels opened this issue 6 years ago • 0 comments

Hi,

First, thanks for this amazing lib !

I'm wondering if the partial update would be accessible through the class DjangoSerializerMutation ?

At the moment, I use to bypass this issue, the following code:

import functools

def partialclass(cls, *args, **kwds):
	class NewCls(cls):
		__init__ = functools.partialmethod(cls.__init__, *args, **kwds)

	return NewCls

and then

class MediaFeedMutation(DjangoSerializerMutation):
	class Meta:
		serializer_class = partialclass(MediaFeedSerializer, partial=True)

yannRavels avatar Apr 08 '18 19:04 yannRavels