【问题标题】:Does graphene-django dynamically create an API documentation?graphene-django 是否动态创建 API 文档?
【发布时间】:2018-07-13 10:51:39
【问题描述】:

我正在考虑将 GraphQL 与 Django 后端服务一起使用,但我找不到太多有关 API 文档的信息。我需要一些解决方案来动态生成文档,可能类似于 npm 的 graphql-docs,其结果类似于 GitHub's API docs

graphene-django可以实现吗?如果没有,python 环境有什么好的替代方案?

【问题讨论】:

    标签: django graphql graphene-python


    【解决方案1】:

    是的,使用嵌入到石墨烯中的GraphiQL 非常容易。

    有关如何将其与石墨烯集成的说明是here in the graphene-python documentation。 --- 基本上你需要在urls.py 文件中设置API 路由时添加参数graphiql=True

    设置完成后,如果在浏览器中转到 API 端点,您会看到一个很好的界面,用于发送 API 调用、获取 API 响应以及阅读查询和突变的文档。文档最初隐藏在右侧,直到您单击“

    【讨论】:

      猜你喜欢
      • 2020-07-08
      • 1970-01-01
      • 2019-07-07
      • 1970-01-01
      • 1970-01-01
      • 2021-03-07
      • 1970-01-01
      • 2011-12-19
      • 2013-08-19
      相关资源
      最近更新 更多