GraphQL Documentation Explorer

GraphQL 文档资源管理器。「GraphQL documentation explorer」

  • 所有者: mhallin/graphql-docs
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

GraphQL Documentation Explorer

Dynamically generated documentation explorer for GraphQL
schemas. It aims to provide a better overview of a schema than
GraphiQL, but without querying features.

Build Status
npm


Example Screenshot

Installation and usage

GraphQL-Docs supports both a dynamic mode and a static mode. In dynamic mode,
GraphQL-Docs tries to work similarly to GraphiQL. Either use the minified files
from GitHub:

<script src="https://github.com/mhallin/graphql-docs/releases/download/v0.2.0/graphql-docs.min.js"></script>
<!-- Note that you need to include React and ReactDOM *before* this script tag -->

Or download it into your own package via NPM:

npm install --save graphql-docs

GraphQL-Docs exposes a single React component that requires a function to run a
query against a server and return a Promise with the result:

function fetcher(query) {
    return fetch(window.location.origin + '/graphql', {
        method: 'POST',
        headers: {
            Accept: 'application/json',
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            query: query,
        }),
    }).then(function(r) {
        return r.json();
    });
}

ReactDOM.render(<GraphQLDocs.GraphQLDocs fetcher={fetcher} />, document.body);

All CSS is included in the Javascript code, so no other dependencies are
required. You can find examples of both the first and second paradigms in the
examples folder.

Static documentation generation

You can also generate a static documentation file based on a schema file or
GraphQL endpoint:

npm install -g graphql-docs

graphql-docs-gen http://GRAPHQL_ENDPOINT documentation.html

Features

  • Markdown rendered documentation (using
    Marked).
  • All types and fields are recursively searched from the schema's root query and
    mutation objects. Types that can't be queried are not included.
  • Field arguments listed in separate tables in the cases where they do contain
    a description.

Planned features

  • Improved layout with some sort of navigation
  • On-page search

主要指标

概览
名称与所有者mhallin/graphql-docs
主编程语言JavaScript
编程语言JavaScript (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2016-05-06 10:30:52
推送于2019-12-12 06:14:56
最后一次提交2016-09-17 20:29:16
发布数6
最新版本名称v0.2.0 (发布于 2016-09-17 20:45:05)
第一版名称v0.1.0 (发布于 2016-05-06 13:51:42)
用户参与
星数115
关注者数4
派生数27
提交数38
已启用问题?
问题数14
打开的问题数11
拉请求数0
打开的拉请求数1
关闭的拉请求数3
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?