GraphQL tutorial with Python (`graphene`)

Original source I followed the linke below. Install library pip -U install graphene Use it import graphene import json class Query(graphene.ObjectType): hello = graphene.String() def resolve_hello(self, info): return "world" schema = graphene.Schema(query=Query) result = schema.execute( ''' { hello } ''' ) data = dict( print(json.dumps(data,indent=2)) Try the code. $ python { "hello": "world" } GraphQL concepts Every GraphQL implementation needs a Query class that contains some fields, every field (not always) must have a resolver function that return data related to the field.