-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Examples * Screenshot * Switch to Markdown for NPM's sake
- Loading branch information
Showing
3 changed files
with
68 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# GraphQL Documentation Explorer | ||
|
||
Dynamically generated documentation explorer for [GraphQL](http://graphql.org) | ||
schemas. It aims to provide a better overview of a schema than | ||
[GraphiQL](https://github.com/graphql/graphiql), but without querying features. | ||
|
||
[![Build Status](https://travis-ci.org/mhallin/graphql-docs.svg?branch=master)](https://travis-ci.org/mhallin/graphql-docs) | ||
[![npm](https://img.shields.io/npm/v/graphql-docs.svg?maxAge=2592000)](https://www.npmjs.com/package/graphql-docs) | ||
|
||
--- | ||
|
||
![Example Screenshot](docs/example.png) | ||
|
||
## Installation and usage | ||
|
||
GraphQL-Docs tries to work similarly to GraphiQL in most areas. Either use the | ||
minified files from GitHub: | ||
|
||
```html | ||
<script src="https://github.com/mhallin/graphql-docs/releases/download/v0.1.2/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: | ||
|
||
```sh | ||
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: | ||
|
||
```javascript | ||
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. | ||
|
||
## Features | ||
|
||
* Markdown rendered documentation (using | ||
[Marked](https://github.com/chjj/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 |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.