Skip to content

Commit 0f5c2e5

Browse files
authored
Move graphql to peerDependencies (#66)
* Move graphql to peerDependencies * Move graphql to peerDependencies
1 parent 7eb5ff9 commit 0f5c2e5

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This package will generate Markdown that beautifully renders your GraphQL schema
1414
in an easily explorable document.
1515

1616
```console
17+
$ yarn add graphql-markdown --dev
1718
$ npm install graphql-markdown --save-dev
1819
```
1920

@@ -24,7 +25,9 @@ $ npm install graphql-markdown --save-dev
2425
### Command Line API
2526

2627
Installing the package adds a `graphql-markdown` script. Point it at a schema
27-
and the output will be written to stdout.
28+
and the output will be written to stdout. You must install `graphql` alongside
29+
this package according to the
30+
[compatible versions specified in `peerDependencies`](./package.json).
2831

2932
The schema may be retrieved from a GraphQL endpoint:
3033

@@ -51,11 +54,12 @@ $ graphql-markdown ./path/to/schema.json > schema.md
5154
```
5255

5356
If `--update-file` is given, the generated Markdown will be output to the given
54-
file between the `<!-- START graphql-markdown -->` and `<!-- END graphql-markdown -->`
55-
comment markers instead of printed to STDOUT. If the file does not exist, it
56-
will be created (and will include the comment markers for future updates). Use
57-
this if you’d like to embed the rendered Markdown as just one part of a larger
58-
document (see also the `--heading-level` option).
57+
file between the `<!-- START graphql-markdown -->` and
58+
`<!-- END graphql-markdown -->` comment markers instead of printed to STDOUT. If
59+
the file does not exist, it will be created (and will include the comment
60+
markers for future updates). Use this if you’d like to embed the rendered
61+
Markdown as just one part of a larger document (see also the `--heading-level`
62+
option).
5963

6064
#### Options
6165

@@ -109,16 +113,17 @@ with a `__schema` property), render the schema to the console or the provided
109113

110114
##### Options
111115

112-
* **`title`**: The title of the document, defaults to “Schema Types”.
113-
* **`prologue`**: Markdown content to include after the title.
114-
* **`epilogue`**: Markdown content to include after everything else.
115-
* **`printer`**: A function to handle each line of output, defaults to `console.log`.
116-
* **`skipTableOfContents`**: When set, rendering of "Table of contents" section
116+
- **`title`**: The title of the document, defaults to “Schema Types”.
117+
- **`prologue`**: Markdown content to include after the title.
118+
- **`epilogue`**: Markdown content to include after everything else.
119+
- **`printer`**: A function to handle each line of output, defaults to
120+
`console.log`.
121+
- **`skipTableOfContents`**: When set, rendering of "Table of contents" section
117122
is skipped.
118-
* **`headingLevel`**: The initial level at which to render Markdown headings in
123+
- **`headingLevel`**: The initial level at which to render Markdown headings in
119124
the output, defaults to 1. Use this if you are using `updateSchema` to embed
120125
the output in a larger document with other sections.
121-
* **`unknownTypeURL`**: A string or function to determine the URL for linking to
126+
- **`unknownTypeURL`**: A string or function to determine the URL for linking to
122127
types that aren’t found in the schema being rendered. This may be the case if
123128
you’re rendering the result of `diffSchema()`, for example. String values will
124129
have `#${type.name.toLowerCase()}` appended, and function values will be
@@ -145,15 +150,14 @@ the effects of a schema extension (e.g. `extend type` definitions).
145150

146151
##### Options
147152

148-
* **`processTypeDiff`**: A function to add or modify fields on each type that
153+
- **`processTypeDiff`**: A function to add or modify fields on each type that
149154
will be output.
150155

151156
## Output
152157

153-
Output is optimized for display on GitHub, using GitHub Flavored Markdown. Due to the
154-
complexity of the tables in the generated document, much of the table output is raw HTML
155-
(as allowed by Markdown).
156-
158+
Output is optimized for display on GitHub, using GitHub Flavored Markdown. Due
159+
to the complexity of the tables in the generated document, much of the table
160+
output is raw HTML (as allowed by Markdown).
157161

158162
[example]: https://github.com/exogen/graphbrainz/blob/master/docs/types.md
159163
[graphbrainz]: https://github.com/exogen/graphbrainz

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434
"git add"
3535
]
3636
},
37+
"peerDependencies": {
38+
"graphql": "^14.0.2 || ^15.0.0"
39+
},
3740
"dependencies": {
3841
"deep-diff": "^1.0.2",
39-
"graphql": "^14.0.2",
4042
"lodash.isplainobject": "^4.0.6",
4143
"minimist": "^1.2.0",
4244
"node-fetch": "^2.2.0",
@@ -53,6 +55,7 @@
5355
"eslint-plugin-promise": "^4.0.1",
5456
"eslint-plugin-standard": "^4.0.0",
5557
"graphbrainz": "^8.1.0",
58+
"graphql": "^14.0.2",
5659
"husky": "^1.1.0",
5760
"jest": "^23.6.0",
5861
"lint-staged": "^7.3.0",

yarn.lock

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,9 +2138,9 @@ graphql@^0.13.2:
21382138
iterall "^1.2.1"
21392139

21402140
graphql@^14.0.2:
2141-
version "14.0.2"
2142-
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.0.2.tgz#7dded337a4c3fd2d075692323384034b357f5650"
2143-
integrity sha512-gUC4YYsaiSJT1h40krG3J+USGlwhzNTXSb4IOZljn9ag5Tj+RkoXrWp+Kh7WyE3t1NCfab5kzCuxBIvOMERMXw==
2141+
version "14.7.0"
2142+
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.7.0.tgz#7fa79a80a69be4a31c27dda824dc04dac2035a72"
2143+
integrity sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA==
21442144
dependencies:
21452145
iterall "^1.2.2"
21462146

@@ -2819,11 +2819,16 @@ istanbul-reports@^1.5.1:
28192819
dependencies:
28202820
handlebars "^4.0.3"
28212821

2822-
iterall@^1.1.3, iterall@^1.2.1, iterall@^1.2.2:
2822+
iterall@^1.1.3, iterall@^1.2.1:
28232823
version "1.2.2"
28242824
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7"
28252825
integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA==
28262826

2827+
iterall@^1.2.2:
2828+
version "1.3.0"
2829+
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea"
2830+
integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==
2831+
28272832
jest-changed-files@^23.4.2:
28282833
version "23.4.2"
28292834
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83"

0 commit comments

Comments
 (0)