mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-28 21:13:47 +03:00
parent
0888c748fd
commit
eb7a0265d8
|
@ -36,7 +36,8 @@ Simple example
|
||||||
# The class attributes define the response of the mutation
|
# The class attributes define the response of the mutation
|
||||||
question = graphene.Field(QuestionType)
|
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 = Question.objects.get(pk=id)
|
||||||
question.text = text
|
question.text = text
|
||||||
question.save()
|
question.save()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user