GraphQL Documentation Explorer

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

  • Owner: mhallin/graphql-docs
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

Main metrics

Overview
Name With Ownermhallin/graphql-docs
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 4)
Platform
License:MIT License
所有者活动
Created At2016-05-06 10:30:52
Pushed At2019-12-12 06:14:56
Last Commit At2016-09-17 20:29:16
Release Count6
Last Release Namev0.2.0 (Posted on 2016-09-17 20:45:05)
First Release Namev0.1.0 (Posted on 2016-05-06 13:51:42)
用户参与
Stargazers Count115
Watchers Count4
Fork Count27
Commits Count38
Has Issues Enabled
Issues Count14
Issue Open Count11
Pull Requests Count0
Pull Requests Open Count1
Pull Requests Close Count3
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private