The easiest way to document your GraphQL schema.
MIT License
.getIntrospectionQuery()
rather than .introspectionQuery
, which means versions of graphql
prior to its introduction in v0.12 are no longer supported.graphql
package was moved from dependencies
to peerDependencies
, so it will no longer be automatically installed with this package. This should mean that there won't potentially be multiple versions of graphql
installed in node_modules
and this package should just inherit whichever you already use (even though it should have already anyway due to it being resolved with resolve-from
).graphql
v15, which removed the deprecated .introspectionQuery
API in favor of .getIntrospectionQuery()
. (#65, @aisapatino)UNION
types. (#53, @nextdude)renderSchema
option, headingLevel
(CLI: --heading-level
), which specifies the initial level of Markdown headings in the generated output.renderSchema
option, skipTitle
(CLI: --no-title
), to skip printing a document title.updateSchema
, which updates an existing Markdown document in-place. It looks for <!-- START graphql-markdown -->
and <!-- END graphql-markdown -->
comment markers and injects the rendered schema between them, so you can print the schema to just one section of the document.--update-file
, which will trigger updateSchema
instead of renderSchema
.renderSchema()
does not have a query type, objects, enums, scalars, or interfaces, the respective section is excluded from the output (instead of printing an empty section).diffSchema()
function for obtaining only the added and updated types and fields between two schemas.renderSchema
option unknownTypeURL
was added. If a type name is being rendered and the type isn't in this schema for whatever reason (maybe it's rendering the result of diffSchema()
), this is a fallback option to potentially point to another document containing the type.This release is available under the next
dist-tag:
yarn add graphql-markdown@next -D
npm install graphql-markdown@next -D
renderSchema()
does not have a query type, objects, enums, scalars, or interfaces, the respective section is excluded from the output (instead of printing an empty section).diffSchema()
function for obtaining only the added and updated types and fields between two schemas.With GitHub's update to GitHub Flavored Markdown, it is no longer necessary to pre-render Markdown content in table cells, as long as there are blank lines surrounding the content.
While not as pretty due to the descriptions being wrapped in <p>
tags (adding bottom padding to even single-line table cells), this significantly simplifies the approach and the output. (#4)
This release makes a few improvements to both the literal and rendered output. (#2)
<p>
styling to be less disruptive within a table cell. Previously, paragraphs would have too much margin/padding around them, misaligning them with non-paragraph content in adjacent cells. Now, paragraph content aligns with non-paragraph content.
graphql-markdown
removed all <p>
tags and ensured multiple paragraphs were separated with <br>
elements.graphql-markdown
still removes <p>
tags if the entire string is a single paragraph (to minimize their unnecessary presence in the output). However, if there are multiple paragraphs, or elements before/after the only paragraph, they will be maintained. This improves the rendering of cases such as lists (and various other non-paragraph elements) following paragraphs (previously, there was not enough whitespace between them).marked
renderer is now called with { gfm: true }
.