Created
May 4, 2024 16:27
-
-
Save ashish-mj/a693e992c766bcd78682e1d4bae6beee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask_graphql import GraphQLView | |
from graphene import Schema,ObjectType,String, Argument | |
from flask import Flask | |
app = Flask(__name__) | |
class Query(ObjectType): | |
hello = String(name = Argument(String, default_value = "World")) | |
def resolve_hello(self, info, name): | |
return 'Hello ' + name | |
schema = Schema(query=Query) | |
app.add_url_rule('/staffday',view_func=GraphQLView.as_view( 'staffday',schema=schema, graphiql=True)) | |
if __name__ == '__main__': | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment