23 lines
353 B
Python
23 lines
353 B
Python
from graphene import Schema, ObjectType, String
|
|
|
|
|
|
class Query(ObjectType):
|
|
hello = String(name=String(default_value="world"))
|
|
|
|
def resolve_hello(self, info, name):
|
|
return "Hello " + name
|
|
|
|
|
|
schema = Schema(query=Query)
|
|
|
|
gql = """
|
|
{
|
|
hello(name: "ghasdf")
|
|
}
|
|
"""
|
|
|
|
|
|
if __name__ == "__main__":
|
|
res = schema.execute(gql)
|
|
print(res)
|