@graphql-markdown/helpers
v1.2.2
Published
GraphQL-Markdown customization helpers.
Readme
@graphql-markdown/helpers
Reusable helpers for customizing GraphQL-Markdown output: rendering custom descriptions and badges from schema directives, wiring directive-based decorators, and shared Markdown-formatting utilities used by formatter presets.
Installation
npm install @graphql-markdown/helpersUsage
Custom directive description
import { directiveDescriptor } from "@graphql-markdown/helpers";
// customDirective.version.descriptor in your GraphQL-Config
export default (directive, type) =>
directiveDescriptor(
directive,
type,
"${description} is ${major}.${minor}.${patch}",
);Custom directive badge
import { directiveTag } from "@graphql-markdown/helpers";
// customDirective.auth.tag in your GraphQL-Config
export default (directive, type) =>
directiveTag(directive, type, "badge--warning");Directive-based decorators
import { withDirective } from "@graphql-markdown/helpers";
const decorator = withDirective("deprecated", (directive, options, context) => {
// render decorator content derived from the directive's definition
});Documentation
License
GraphQL-Markdown packages are 100% free and open-source, under the MIT license.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest, you'll be creating employment for local families and restoring wildlife habitats.
