From 888d5037daa916b38faf532d6485ccecfa7ba900 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Fri, 10 Jun 2016 01:43:06 -0700 Subject: [PATCH] Update mutation example --- UPGRADE-v1.0.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UPGRADE-v1.0.md b/UPGRADE-v1.0.md index a307ccd2..b252b408 100644 --- a/UPGRADE-v1.0.md +++ b/UPGRADE-v1.0.md @@ -40,10 +40,13 @@ from graphene import ObjectType, Mutation, String class ReverseString(Mutation): class Input: - input = String() + input = String(required=True) reversed = String() + def mutate(self, args, context, info): + reversed = args.get('input')[::-1] + return ReverseString(reversed=reversed) class Query(ObjectType): reverse_string = graphene.Field(ReverseString) # Old way, not working anymore