Ai
1 Star 0 Fork 0

pashanhu/flask_graphql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.py 702 Bytes
一键复制 编辑 原始数据 按行查看 历史
Your Name 提交于 2019-04-14 22:44 +08:00 . 0
#https://blog.csdn.net/dmjz_lk/article/details/87784645
#https://graphene-python.org/
from flask import Flask
import graphene
#from flask_graphql import GraphQLView
from flask_graphql.graphqlview import GraphQLView
class Query(graphene.ObjectType):
hello_world= graphene.String(description='ces')
@staticmethod
def resolve_hello_world(obj, info, **kwargs):
return "Hello World!"
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
schema = graphene.Schema(query=Query, auto_camelcase=False)
app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=schema, graphiql=True))
if __name__=='__main__':
app.run('0.0.0.0',port=5555)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/jpython/flask_graphql.git
git@gitee.com:jpython/flask_graphql.git
jpython
flask_graphql
flask_graphql
master

搜索帮助