Python_05_Flask / Code /GraphQL /01_hello_graphql.py
zxy0307's picture
Upload 181 files
1b5b024 verified
Raw History Blame Contribute Delete
329 Bytes
from graphene import Schema,ObjectType,String
class Query(ObjectType):
say = String()
def resolve_say(self,info):
return 'Hello GraphQL!!'
if __name__ == '__main__':
schema = Schema(query= Query)
query_string='''
{
say
}
'''
rs = schema.execute(query_string)
print(rs.data)