Files
responder/g.py
T
2018-10-09 06:45:02 -04:00

14 lines
306 B
Python

import graphene
class Query(graphene.ObjectType):
hello = graphene.String(name=graphene.String(default_value="stranger"))
def resolve_hello(self, info, name):
return "Hello " + name
schema = graphene.Schema(query=Query)
result = schema.execute("{ hello }")
print(result.data["hello"])