Last active
June 23, 2017 00:40
-
-
Save gamesbrainiac/7ef68f13cf177860da291b689bc35719 to your computer and use it in GitHub Desktop.
2017_06_22_graphql-in-the-python-world
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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