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

perform_mutate method in DjangoSerializerMutation and Getting the newly created object while still in Mutation

Open IdemenB opened this issue 3 years ago • 0 comments

Hi @eamigo86, what is the purpose of returning "return cls(**resp)" in the perform_mutate method of the DjangoSerializerMutation class? If we simple return "resp" itself we gain the ability to directly get the object that is created as a result of the Mutation.

If we do not change this, how can we get the created object while we are still in the Mutation we subclassed from DjangoSerializerMutation?

Exact location:

https://github.com/eamigo86/graphene-django-extras/blob/abb5a333ef74a3c0aa0ce50ee896ae1c3c3b3c32/graphene_django_extras/mutation.py#L155

IdemenB avatar Dec 05 '20 18:12 IdemenB