Skip to content

Instantly share code, notes, and snippets.

@gamesbrainiac
Last active June 23, 2017 00:40
Show Gist options
  • Save gamesbrainiac/7ef68f13cf177860da291b689bc35719 to your computer and use it in GitHub Desktop.
Save gamesbrainiac/7ef68f13cf177860da291b689bc35719 to your computer and use it in GitHub Desktop.
2017_06_22_graphql-in-the-python-world
import graphene # 1
class Query(graphene.ObjectType): # 2
hello = graphene.String(description='A typical hello world') # 3
def resolve_hello(self, args, context, info): # 4
return 'World'
schema = graphene.Schema(query=Query) # 5
query = '''
query {
hello
}
''' # 6
result = schema.execute(query) # 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment