@graphql-markdown/helpers
Advanced tools
/** | ||
* Custom directive `descriptor` helper. | ||
* | ||
* @see {@link https://graphql-markdown.dev/docs/advanced/custom-directive#descriptor | Option `customDirective.[directive].descriptor`} | ||
* @see [Option `customDirective.[directive].descriptor`](https://graphql-markdown.dev/docs/advanced/custom-directive#descriptor) | ||
* | ||
@@ -77,2 +77,2 @@ * @packageDocumentation | ||
*/ | ||
export declare function directiveDescriptor(directive: GraphQLDirective, type?: unknown, descriptionTemplate?: string): string; | ||
export declare const directiveDescriptor: (directive: GraphQLDirective, type?: unknown, descriptionTemplate?: string) => string; |
@@ -5,3 +5,3 @@ "use strict"; | ||
* | ||
* @see {@link https://graphql-markdown.dev/docs/advanced/custom-directive#descriptor | Option `customDirective.[directive].descriptor`} | ||
* @see [Option `customDirective.[directive].descriptor`](https://graphql-markdown.dev/docs/advanced/custom-directive#descriptor) | ||
* | ||
@@ -11,3 +11,3 @@ * @packageDocumentation | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.directiveDescriptor = directiveDescriptor; | ||
exports.directiveDescriptor = void 0; | ||
const graphql_1 = require("@graphql-markdown/graphql"); | ||
@@ -83,3 +83,3 @@ const interpolate_1 = require("../utils/interpolate"); | ||
*/ | ||
function directiveDescriptor(directive, type, descriptionTemplate) { | ||
const directiveDescriptor = (directive, type, descriptionTemplate) => { | ||
const values = (0, graphql_1.getTypeDirectiveValues)(directive, type); | ||
@@ -92,2 +92,3 @@ const description = directive.description ?? ""; | ||
return (0, interpolate_1.interpolate)(descriptionTemplate, params); | ||
} | ||
}; | ||
exports.directiveDescriptor = directiveDescriptor; |
/** | ||
* Custom directive `tag` helper. | ||
* | ||
* @see {@link https://graphql-markdown.dev/docs/advanced/custom-directive#tag | Option `customDirective.[directive].tag`} | ||
* @see [Option `customDirective.[directive].tag`](https://graphql-markdown.dev/docs/advanced/custom-directive#tag) | ||
* | ||
@@ -49,2 +49,2 @@ * @packageDocumentation | ||
*/ | ||
export declare function directiveTag(directive: GraphQLDirective, type?: unknown, classname?: string): Badge; | ||
export declare const directiveTag: (directive: GraphQLDirective, type?: unknown, classname?: string) => Badge; |
@@ -5,3 +5,3 @@ "use strict"; | ||
* | ||
* @see {@link https://graphql-markdown.dev/docs/advanced/custom-directive#tag | Option `customDirective.[directive].tag`} | ||
* @see [Option `customDirective.[directive].tag`](https://graphql-markdown.dev/docs/advanced/custom-directive#tag) | ||
* | ||
@@ -11,3 +11,3 @@ * @packageDocumentation | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.directiveTag = directiveTag; | ||
exports.directiveTag = void 0; | ||
/** | ||
@@ -53,3 +53,3 @@ * Helper for rendering custom description from schema directive on type. | ||
*/ | ||
function directiveTag(directive, type, classname = "badge--secondary") { | ||
const directiveTag = (directive, type, classname = "badge--secondary") => { | ||
return { | ||
@@ -59,2 +59,3 @@ text: `@${directive.name}`, | ||
}; | ||
} | ||
}; | ||
exports.directiveTag = directiveTag; |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"license": "MIT", | ||
@@ -60,4 +60,4 @@ "repository": { | ||
"dependencies": { | ||
"@graphql-markdown/graphql": "^1.1.6", | ||
"@graphql-markdown/utils": "^1.8.0" | ||
"@graphql-markdown/graphql": "^1.1.7", | ||
"@graphql-markdown/utils": "^1.8.1" | ||
}, | ||
@@ -64,0 +64,0 @@ "peerDependencies": { |
17941
0.29%407
0.49%