Skip to content

Commit

Permalink
Use explicit classmethod in simple mutation example
Browse files Browse the repository at this point in the history
rel #1038
  • Loading branch information
artofhuman committed Nov 8, 2020
1 parent 0888c74 commit dd5b1e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/mutations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dd5b1e7

Please sign in to comment.