@@ -14,6 +14,7 @@ This package will generate Markdown that beautifully renders your GraphQL schema
1414in 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
2627Installing 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
2932The schema may be retrieved from a GraphQL endpoint:
3033
@@ -51,11 +54,12 @@ $ graphql-markdown ./path/to/schema.json > schema.md
5154```
5255
5356If ` --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
0 commit comments