From dd5b1e7648e75098f608be8278f55baa851fc482 Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Sun, 8 Nov 2020 18:12:33 +0500 Subject: [PATCH] Use explicit classmethod in simple mutation example rel #1038 --- docs/mutations.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/mutations.rst b/docs/mutations.rst index aef32eb..9b6f179 100644 --- a/docs/mutations.rst +++ b/docs/mutations.rst @@ -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()