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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?