Skip to content

Commit 0679f4a

Browse files
committed
rename everything
1 parent cea9cb9 commit 0679f4a

19 files changed

+157
-188
lines changed

README.md

Lines changed: 26 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,48 @@
1-
# Static page generator for documenting GraphQL Schema
1+
# Generate GraphQL docs from schema.
22

3-
[![Build Status](https://travis-ci.org/2fd/graphdoc.svg?branch=master)](https://travis-ci.org/2fd/graphdoc)
4-
![npm (scoped)](https://img.shields.io/npm/v/@2fd/graphdoc.svg?style=flat-square)
5-
![GitHub tag](https://img.shields.io/github/tag/2fd/graphdoc.svg?style=flat-square)
6-
7-
* [demos](#demos)
83
* [install](#install)
94
* [use](#use)
105
* [plugin](#plugin)
11-
* [template](#template)
12-
* [contributors](#contributors)
13-
14-
## Demos
156

16-
* Facebook Test [Star Wars](https://2fd.github.io/graphdoc/star-wars)
17-
* [Github V4 API](https://2fd.github.io/graphdoc/github)
18-
* [Shopify API](https://2fd.github.io/graphdoc/shopify/)
19-
* [Pokemon GraphQL](https://2fd.github.io/graphdoc/pokemon)
7+
Forked from the excellent but unfortunately unmaintained [graphdoc package](https://github.com/2fd/graphdoc).
208

219
## Install
2210

11+
To install globally:
2312
```bash
24-
npm install -g @2fd/graphdoc
13+
npm install -g graphqldoc
2514
```
2615

2716
## Use
2817

2918
### Generate documentation from live endpoint
3019

3120
```bash
32-
> graphdoc -e http://localhost:8080/graphql -o ./doc/schema
21+
> graphqldoc -e http://localhost:8080/graphql -o ./doc/schema
3322
```
3423

3524
### Generate documentation from IDL file
3625

3726
```bash
38-
> graphdoc -s ./schema.graphql -o ./doc/schema
27+
> graphqldoc -s ./schema.graphql -o ./doc/schema
3928
```
4029

4130
### Generate documentation from for the ["modularized schema"](http://dev.apollodata.com/tools/graphql-tools/generate-schema.html#modularizing) of graphql-tools
4231

4332
```bash
44-
> graphdoc -s ./schema.js -o ./doc/schema
33+
> graphqldoc -s ./schema.js -o ./doc/schema
4534
```
4635

47-
> [`./schema.graphql`](https://github.com/2fd/graphdoc/blob/master/test/starwars.graphql) must be able to be interpreted with [graphql-js/utilities#buildSchema](http://graphql.org/graphql-js/utilities/#buildschema)
36+
> `./schema.graphql` must be able to be interpreted with [graphql-js/utilities#buildSchema](http://graphql.org/graphql-js/utilities/#buildschema)
4837
4938

5039
### Generate documentation from json file
5140

5241
```bash
53-
> graphdoc -s ./schema.json -o ./doc/schema
42+
> graphqldoc -s ./schema.json -o ./doc/schema
5443
```
5544

56-
> `./schema.json` contains the result of [GraphQL introspection query](https://github.com/2fd/graphdoc/blob/gh-pages/introspection.graphql)
45+
> `./schema.json` contains the result of GraphQL introspection query.
5746
5847
### Puts the options in your `package.json`
5948

@@ -63,7 +52,7 @@
6352
{
6453
"name": "project",
6554
// [...]
66-
"graphdoc": {
55+
"graphqldoc": {
6756
"endpoint": "http://localhost:8080/graphql",
6857
"output": "./doc/schema",
6958
}
@@ -73,18 +62,18 @@
7362
And execute
7463

7564
```bash
76-
> graphdoc
65+
> graphqldoc
7766
```
7867

7968
### Help
8069

8170
```bash
8271

83-
> graphdoc -h
72+
> graphqldoc -h
8473

8574
Static page generator for documenting GraphQL Schema v2.4.0
8675

87-
Usage: node bin/graphdoc.js [OPTIONS]
76+
Usage: node bin/graphqldoc.js [OPTIONS]
8877

8978

9079
PTIONS]:
@@ -93,25 +82,25 @@ And execute
9382
-x, --header HTTP header for request (use with --endpoint). ["Authorization: Token cb8795e7"].
9483
-q, --query HTTP querystring for request (use with --endpoint) ["token=cb8795e7"].
9584
-s, --schema, --schema-file Graphql Schema file ["./schema.json"].
96-
-p, --plugin Use plugins [default=graphdoc/plugins/default].
97-
-t, --template Use template [default=graphdoc/template/slds].
85+
-p, --plugin Use plugins [default=graphqldoc/plugins/default].
86+
-t, --template Use template [default=graphqldoc/template/slds].
9887
-o, --output Output directory.
9988
-d, --data Inject custom data.
10089
-b, --base-url Base url for templates.
10190
-f, --force Delete outputDirectory if exists.
10291
-v, --verbose Output more information.
103-
-V, --version Show graphdoc version.
92+
-V, --version Show graphqldoc version.
10493
-h, --help Print this help
10594

10695

10796
```
10897
10998
## Plugin
11099
111-
In graphdoc a plugin is simply an object that controls the content that is displayed
100+
In graphqldoc a plugin is simply an object that controls the content that is displayed
112101
on every page of your document.
113102
114-
This object should only implement the [`PluginInterface`](https://github.com/2fd/graphdoc/blob/master/lib/interface.d.ts#L12-L117).
103+
This object should only implement the [`PluginInterface`](https://github.com/menewman/graphqldoc/blob/master/lib/interface.d.ts#L12-L117).
115104
116105
### Make a Plugin
117106
@@ -121,9 +110,9 @@ or a `constructor` and export it as `default`
121110
If you export your plugin as a constructor, when going to be initialized,
122111
will receive three parameters
123112
124-
* `schema`: The full the result of [GraphQL instrospection query](https://github.com/2fd/graphdoc/blob/gh-pages/introspection.graphql)
113+
* `schema`: The full the result of GraphQL instrospection query.
125114
* `projectPackage`: The content of `package.json` of current project (or the content of file defined with `--config` flag).
126-
* `graphdocPackag`: The content of `package.json` of graphdoc.
115+
* `graphqldocPackage`: The content of `package.json` of graphqldoc.
127116
128117
> For performance reasons all plugins receive the reference to the same object
129118
> and therefore should not modify them directly as it could affect the behavior
@@ -135,7 +124,7 @@ will receive three parameters
135124

136125
// es2015 export constructor
137126
export default class MyPlugin {
138-
constructor(schema, projectPackage, graphdocPackag){}
127+
constructor(schema, projectPackage, graphqldocPackage){}
139128
getAssets() { /* ... */ }
140129
/* ... */
141130
}
@@ -153,7 +142,7 @@ will receive three parameters
153142
```javascript
154143

155144
// export constructor
156-
function MyPlugin(schema, projectPackage, graphdocPackage) { /* ... */ }
145+
function MyPlugin(schema, projectPackage, graphqldocPackage) { /* ... */ }
157146

158147
MyPlugin.prototype.getAssets = function() { /* ... */ };
159148
/* ... */
@@ -180,7 +169,7 @@ You can use the plugins in 2 ways.
180169
#### Use plugins with command line
181170
182171
```bash
183-
> graphdoc -p graphdoc/plugins/default \
172+
> graphqldoc -p graphqldoc/plugins/default \
184173
-p some-dependencie/plugin \
185174
-p ./lib/plugin/my-own-plugin \
186175
-s ./schema.json -o ./doc/schema
@@ -194,29 +183,14 @@ You can use the plugins in 2 ways.
194183
{
195184
"name": "project",
196185
// [...]
197-
"graphdoc": {
186+
"graphqldoc": {
198187
"endpoint": "http://localhost:8080/graphql",
199188
"output": "./doc/schema",
200189
"plugins": [
201-
"graphdoc/plugins/default",
190+
"graphqldoc/plugins/default",
202191
"some-dependencie/plugin",
203192
"./lib/plugin/my-own-plugin"
204193
]
205194
}
206195
}
207196
```
208-
209-
### Build-in plugin
210-
211-
> TODO
212-
213-
## Template
214-
215-
> TODO
216-
217-
218-
## Contributors
219-
220-
- [<img src="https://avatars2.githubusercontent.com/u/1301838?v=4" width="40"> bitliner](https://github.com/bitliner)
221-
- [<img src="https://avatars0.githubusercontent.com/u/605742?v=4" width="40"> kbariotis](https://github.com/kbariotis)
222-
- [<img src="https://avatars1.githubusercontent.com/u/2903325?v=4" width="40"> dnalborczyk](https://github.com/dnalborczyk)
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env node
22

33
"use strict";
4-
var command_1 = require('@2fd/command');
5-
var command_2 = require('../lib/command');
4+
let command_1 = require('@2fd/command');
5+
let command_2 = require('../lib/command');
6+
67
(new command_2.GraphQLDocumentor)
7-
.handle(new command_1.ArgvInput(process.argv), new command_1.ColorConsoleOutput);
8+
.handle(new command_1.ArgvInput(process.argv), new command_1.ColorConsoleOutput);

example.github.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"mustache": "^2.2.1",
1414
"request": "^2.79.0"
1515
},
16-
"graphdoc": {
16+
"graphqldoc": {
1717
"ga": "UA-54154153-2",
1818
"graphiql": "https://developer.github.com/early-access/graphql/explorer/",
1919
"logo": "<a href=\"https://developer.github.com/early-access/graphql\" target=\"_blank\" style=\"display:block;padding:1rem 3rem\"><img src=\"https://assets-cdn.github.com/images/modules/logos_page/GitHub-Logo.png\" /></a>",

example.pokemon.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"homepage": "https://github.com/lucasbento/graphql-pokemon#readme",
1212
"license": "MIT",
1313
"repository": "https://github.com/lucasbento/graphql-pokemon",
14-
"graphdoc": {
14+
"graphqldoc": {
1515
"ga": "UA-54154153-2",
1616
"graphiql": "https://graphql-pokemon.now.sh/",
1717
"logo": "<a href=\"https://github.com/lucasbento/graphql-pokemon\" target=\"_blank\" style=\"display:block;padding:1rem 35%\"><img src=\"https://raw.githubusercontent.com/lucasbento/graphql-pokemon/master/content/logo.png\" /></a>",

example.shopify.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "graphql-pokemon",
33
"description": "Get information of a Pokémon with GraphQL!",
4-
"graphdoc": {
4+
"graphqldoc": {
55
"ga": "UA-54154153-2",
66
"graphiql": "https://help.shopify.com/api/storefront-api/graphql-explorer/graphiql",
77
"logo": "<a href=\"/shopify\" target=\"_blank\" style=\"display:block;padding:1rem 15%\"><img src=\"https://upload.wikimedia.org/wikipedia/commons/e/e1/Shopify_Logo.png\" /></a>",

example.starWars-js.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@2fd/graphdoc",
2+
"name": "graphql-star-wars-js",
33
"version": "1.2.0",
44
"description": "Static page generator for documenting GraphQL Schema",
5-
"homepage": "https://github.com/2fd/graphdoc#readme",
6-
"graphdoc": {
5+
"homepage": "https://github.com/menewman/graphqldoc",
6+
"graphqldoc": {
77
"ga": "UA-54154153-2",
88
"schemaFile": "./test/starWars.js",
99
"output": "./gh-pages/star-wars",

example.starWars.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@2fd/graphdoc",
2+
"name": "graphql-star-wars",
33
"version": "1.2.0",
44
"description": "Static page generator for documenting GraphQL Schema",
5-
"homepage": "https://github.com/2fd/graphdoc#readme",
6-
"graphdoc": {
5+
"homepage": "https://github.com/menewman/graphqldoc",
6+
"graphqldoc": {
77
"ga": "UA-54154153-2",
88
"schemaFile": "./test/starwars.graphql",
99
"output": "./gh-pages/star-wars",

0 commit comments

Comments
 (0)