From c2043f25b1f988bb6720bb70a45244be34ef3e65 Mon Sep 17 00:00:00 2001 From: Mohit Ahuja Date: Tue, 20 Mar 2018 10:42:02 +0100 Subject: [PATCH 1/2] python hello world example fix --- site/code/index.html.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site/code/index.html.js b/site/code/index.html.js index 63d2db059b..9982a818e0 100644 --- a/site/code/index.html.js +++ b/site/code/index.html.js @@ -320,14 +320,14 @@ Then run \`python hello.py\` with this code in \`hello.py\`: import graphene class Query(graphene.ObjectType): - hello = graphene.String() + hello = graphene.String(name=graphene.String(default_value="World")) - def resolve_hello(self, args, context, info): - return 'Hello world!' + def resolve_hello(self, info, name): + return 'Hello ' + name schema = graphene.Schema(query=Query) result = schema.execute('{ hello }') -print(result.data['hello']) +print(result.data['hello']) # "Hello World" \`\`\` There are also nice bindings for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine. From 2636c020c0e48a18b6d0cf26e776d61ba669c9e7 Mon Sep 17 00:00:00 2001 From: Mohit Ahuja Date: Tue, 20 Mar 2018 10:46:49 +0100 Subject: [PATCH 2/2] fixing code --- site/code/index.html.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/code/index.html.js b/site/code/index.html.js index 9982a818e0..993f36d3e8 100644 --- a/site/code/index.html.js +++ b/site/code/index.html.js @@ -322,8 +322,8 @@ import graphene class Query(graphene.ObjectType): hello = graphene.String(name=graphene.String(default_value="World")) - def resolve_hello(self, info, name): - return 'Hello ' + name + def resolve_hello(self, info, name): + return 'Hello ' + name schema = graphene.Schema(query=Query) result = schema.execute('{ hello }')