PedroBern / django-graphql-auth

Django registration and authentication with GraphQL.
https://django-graphql-auth.readthedocs.io/en/latest/
MIT License
333 stars 105 forks source link

Fix UpdateAccount to accept optional arguments for partial updates #129

Closed aalhendi closed 2 years ago

aalhendi commented 3 years ago

This fixes issue #69 .

The inputs are first made optional by setting required = False. This causes an overwrite of the previous state of the account. In order to update only the inputs being passed from the mutation, the current values are appended in the mixin as kwargs before saving

haris1998-web commented 2 years ago

@PedroBern @ulgens @pors Kindly take a look at this fix as it is much needed.

ulgens commented 2 years ago

I feel like the solution is a bit hacky even if it works, and I didn't want to merge without any other maintainer's approval. If there is no objection in the next couple of days, I can merge it.