@graphql-markdown/docusaurus
Advanced tools
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.0 - 2023-04-02
Lot of changes in this release 🚀
skipDocDirective
and --skip
now support multiple valuesprintTypeOptions.deprecated
and --deprecated
give more control over deprecated
types, based on an initial request from @patrys in #735<img width="400" alt="custom-deprecated-section-5b7fd7a5deebdcddb64e68c8958f355a" src="https://user-images.githubusercontent.com/324670/229355935-263ce6cb-a7f7-4d13-a295-5661fcb23f83.png">The new option
printTypeOptions.deprecated
comes with several options (see documentation), and the most exciting of those allows@deprecated
entities to be grouped together - and, it is customisable (see documentation).