mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-22 09:37:07 +03:00
parent
0888c748fd
commit
eb7a0265d8
|
@ -36,7 +36,8 @@ Simple example
|
|||
# The class attributes define the response of the mutation
|
||||
question = graphene.Field(QuestionType)
|
||||
|
||||
def mutate(self, info, text, id):
|
||||
@classmethod
|
||||
def mutate(cls, root, info, text, id):
|
||||
question = Question.objects.get(pk=id)
|
||||
question.text = text
|
||||
question.save()
|
||||
|
|
Loading…
Reference in New Issue
Block a user