udemy-graphql/main.py
Tyrel Souza 867c5164d3
init
2023-12-18 15:36:42 -05:00

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)