@graphql-markdown/docusaurus
Advanced tools
Changelog
1.20.2 - 2023-07-07
:sparkles: New option printTypeOptions.codeSection
and CLI flag --noCode
for hiding the codeblock section, based on an initial request from @ris314 in #895. See documentation for more information.
Changelog
1.20.0 - 2023-07-01
:sparkles: GraphQL Config is now supported, see the documentation for more information and limitations :rocket:
This is the default set up when creating a new site using the template.
First install the package graphql-config
, then you are ready to go.
npm install graphql-config
Example .graphqlrc
:
schema: "https://graphql.anilist.co/"
extensions:
graphql-markdown:
linkRoot: "/examples/default"
baseURL: "."
homepage: "data/anilist.md"
loaders:
UrlLoader:
module: "@graphql-tools/url-loader"
options:
method: "POST"
printTypeOptions:
deprecated: "group"
docOptions:
pagination: false
toc: false
Changelog
1.19.0 - 2023-06-03
:warning: This release introduces minor breaking changes, see section breaking changes.
:label: Building upon customDirective
released in 1.18.0, we added a new option tag
that allows one to display custom badges (tags) in the documentation pages.
The feature is an extension of the customDirective
by using the already available directive processing. It works the same way as descriptor
, and it also comes with an helper directiveTag
... more details in the documentation.
customDirective: {
beta: {
tag: (directive) => ({
text: directive?.name.toUpperCase(),
classname: "badge--danger",
}),
},
Since tags have now a dedicated handler, the directives declared in customDirective
for descriptor
won't display a badge. A helper helper.directiveTag
is provided for backward compatibility.
Users who want to keep the previous behavior just need to declare tag: helper.directiveTag
for each directive declared.
const { helper } = require("@graphql-markdown/utils");
//---//
auth: {
descriptor: (directive, type) =>
helper.directiveDescriptor(
directive,
type,
"This requires the current user to be in `${requires}` role.",
),
tag: helper.directiveTag,
},
The deprecated "warning badge" has been changed into an admonition for a clearer UI.
Last change is the change of position of the custom directive descriptions that are now after the type description instead of before.
Changelog
1.18.2 - 2023-06-01
:sparkle: Add wildcard *
support for customDirective
, more details in the documentation.
Changelog
1.18.1 - 2023-05-07
:bug: Fix missing code indentation for fields in some cases (#850) by @ljiang-ti in #851.
Changelog
1.18.0 - 2023-05-05
:star_struck: A new really cool feature by @ljiang-ti, customDirective
provides documentation of schema directives at type level. One can now choose to print a custom description for schema directives applying to a type or field. :sparkles:
:point_right: ~There is a open discussion for this feature, and the possible improvements.~
plugins: [
[
"@graphql-markdown/docusaurus",
{
// ... other options
customDirective: {
auth: {
descriptor: (directive, type) =>
directiveDescriptor(
directive,
type,
"This requires the current user to be in `${requires}` role.",
),
},
// ... other custom directive options
},
},
],
],
If you want to see it live, the group-by
example documentation has been updated to showcase the feature.
You can find more examples and information regarding helpers to get you started in the documentation.
Changelog
1.17.1 - 2023-04-16
🐞 Fix some inconsistencies when handling @deprecated
directive:
@deprecated
is now printed in code snippets for a better visibilityprintDeprecated: "skip"
skips all deprecated types, including types in code snippets and metadata (fields, enum values)