eamigo86 / graphene-django-extras

Extras functionalities for Graphene-Django
MIT License
417 stars 107 forks source link

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

Open IdemenB opened 3 years ago

IdemenB commented 3 years ago

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