一个简单的基于模型的graphql api配置器,用python编写,基于django
pnp-graphql的Python项目详细描述
即插即用图形ql(pnp图形ql)--Change Log
A library for making GraphQL API with Python/Django. This is like a flash drive, just how you plug into computer and transfer files.
快速启动
Documentation is coming soon...
- 从pip安装
pip install pnp-graphql
- 将
graphene_django
添加到settings.py上安装的应用程序之上 - 将
pnp_graphql
添加到settings.py上已安装的应用程序中 - 在设置上添加pnp graphql config。
GRAPHENE={'SCHEMA':'pnp_graphql.schema.schema'}PNP_GRAPHQL={'ENABLED_APPS':['example_app'],# If you want to use Token Authentication. Otherwise it's optional'AUTHENTICATION_CLASS':'pnp_graphql.authentication.TokenAuthentication'}
- 为生产使用设置
DEBUG = False
。
就这样:)
现在请访问:http://your-ip:port/api/graphql-explorer/以了解有关查询的explore graphql内置ui资源管理器。
production ready api:http://your-ip:port/api/graphql/
什么在起作用?
- graphql查询
- 变异(创建、更新、删除)
- 分页
- 对数字、字符串、日期和日期时间进行API筛选
- 身份验证
- 正确的错误处理
- 现场验证
- 缓存
- 更多………