-
Hi |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Can you provide some starter code here to help us? |
Beta Was this translation helpful? Give feedback.
-
DjangoFormMuation has a method: |
Beta Was this translation helpful? Give feedback.
-
You can do something like this: from django.contrib.auth.forms import PasswordChangeForm
from graphene_django.forms.mutation import DjangoFormMutation
class MyPasswordChangeForm(PasswordChangeForm):
def __init__(self, *args, **kwargs):
user = kwargs.pop('user', None)
super().__init__(user, *args, **kwargs)
class ChangePassword(DjangoFormMutation):
class Meta:
form_class = MyPasswordChangeForm
@classmethod
def get_form_kwargs(cls, root, info, **mutation_input):
return {**super().get_form_kwargs(root, info, **mutation_input), 'user': info.context.user} |
Beta Was this translation helpful? Give feedback.
You can do something like this: