Skip to content

Commit

Permalink
Move graphql to peerDependencies (#66)
Browse files Browse the repository at this point in the history
* Move graphql to peerDependencies

* Move graphql to peerDependencies
  • Loading branch information
exogen committed Feb 2, 2021
1 parent 7eb5ff9 commit 0f5c2e5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This package will generate Markdown that beautifully renders your GraphQL schema
in an easily explorable document.

```console
$ yarn add graphql-markdown --dev
$ npm install graphql-markdown --save-dev
```

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

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

The schema may be retrieved from a GraphQL endpoint:

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

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

#### Options

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

##### Options

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

##### Options

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

## Output

Output is optimized for display on GitHub, using GitHub Flavored Markdown. Due to the
complexity of the tables in the generated document, much of the table output is raw HTML
(as allowed by Markdown).

Output is optimized for display on GitHub, using GitHub Flavored Markdown. Due
to the complexity of the tables in the generated document, much of the table
output is raw HTML (as allowed by Markdown).

[example]: https://github.com/exogen/graphbrainz/blob/master/docs/types.md
[graphbrainz]: https://github.com/exogen/graphbrainz
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
"git add"
]
},
"peerDependencies": {
"graphql": "^14.0.2 || ^15.0.0"
},
"dependencies": {
"deep-diff": "^1.0.2",
"graphql": "^14.0.2",
"lodash.isplainobject": "^4.0.6",
"minimist": "^1.2.0",
"node-fetch": "^2.2.0",
Expand All @@ -53,6 +55,7 @@
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"graphbrainz": "^8.1.0",
"graphql": "^14.0.2",
"husky": "^1.1.0",
"jest": "^23.6.0",
"lint-staged": "^7.3.0",
Expand Down
13 changes: 9 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2138,9 +2138,9 @@ graphql@^0.13.2:
iterall "^1.2.1"

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

Expand Down Expand Up @@ -2819,11 +2819,16 @@ istanbul-reports@^1.5.1:
dependencies:
handlebars "^4.0.3"

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

iterall@^1.2.2:
version "1.3.0"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea"
integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==

jest-changed-files@^23.4.2:
version "23.4.2"
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83"
Expand Down

0 comments on commit 0f5c2e5

Please sign in to comment.