@graphql-markdown/helpers 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom directive `descriptor` helper.
|
|
3
3
|
*
|
|
4
|
-
* @see
|
|
4
|
+
* @see [Option `customDirective.[directive].descriptor`](https://graphql-markdown.dev/docs/advanced/custom-directive#descriptor)
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
@@ -74,4 +74,4 @@ import type { GraphQLDirective } from "@graphql-markdown/types";
|
|
|
74
74
|
* ```
|
|
75
75
|
*
|
|
76
76
|
*/
|
|
77
|
-
export declare
|
|
77
|
+
export declare const directiveDescriptor: (directive: GraphQLDirective, type?: unknown, descriptionTemplate?: string) => string;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Custom directive `descriptor` helper.
|
|
4
4
|
*
|
|
5
|
-
* @see
|
|
5
|
+
* @see [Option `customDirective.[directive].descriptor`](https://graphql-markdown.dev/docs/advanced/custom-directive#descriptor)
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.directiveDescriptor =
|
|
10
|
+
exports.directiveDescriptor = void 0;
|
|
11
11
|
const graphql_1 = require("@graphql-markdown/graphql");
|
|
12
12
|
const interpolate_1 = require("../utils/interpolate");
|
|
13
13
|
/**
|
|
@@ -78,7 +78,7 @@ const interpolate_1 = require("../utils/interpolate");
|
|
|
78
78
|
* ```
|
|
79
79
|
*
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
const directiveDescriptor = (directive, type, descriptionTemplate) => {
|
|
82
82
|
const values = (0, graphql_1.getTypeDirectiveValues)(directive, type);
|
|
83
83
|
const description = directive.description ?? "";
|
|
84
84
|
const params = { description, ...values };
|
|
@@ -86,4 +86,5 @@ function directiveDescriptor(directive, type, descriptionTemplate) {
|
|
|
86
86
|
return (0, interpolate_1.interpolate)(description, params);
|
|
87
87
|
}
|
|
88
88
|
return (0, interpolate_1.interpolate)(descriptionTemplate, params);
|
|
89
|
-
}
|
|
89
|
+
};
|
|
90
|
+
exports.directiveDescriptor = directiveDescriptor;
|
package/dist/directives/tag.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom directive `tag` helper.
|
|
3
3
|
*
|
|
4
|
-
* @see
|
|
4
|
+
* @see [Option `customDirective.[directive].tag`](https://graphql-markdown.dev/docs/advanced/custom-directive#tag)
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
@@ -46,4 +46,4 @@ import type { Badge, GraphQLDirective } from "@graphql-markdown/types";
|
|
|
46
46
|
* ```
|
|
47
47
|
*
|
|
48
48
|
*/
|
|
49
|
-
export declare
|
|
49
|
+
export declare const directiveTag: (directive: GraphQLDirective, type?: unknown, classname?: string) => Badge;
|
package/dist/directives/tag.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Custom directive `tag` helper.
|
|
4
4
|
*
|
|
5
|
-
* @see
|
|
5
|
+
* @see [Option `customDirective.[directive].tag`](https://graphql-markdown.dev/docs/advanced/custom-directive#tag)
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.directiveTag =
|
|
10
|
+
exports.directiveTag = void 0;
|
|
11
11
|
/**
|
|
12
12
|
* Helper for rendering custom description from schema directive on type.
|
|
13
13
|
* This is an example on how to build a custom `tag` callback.
|
|
@@ -48,9 +48,10 @@ exports.directiveTag = directiveTag;
|
|
|
48
48
|
* ```
|
|
49
49
|
*
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
const directiveTag = (directive, type, classname = "badge--secondary") => {
|
|
52
52
|
return {
|
|
53
53
|
text: `@${directive.name}`,
|
|
54
54
|
classname: classname,
|
|
55
55
|
};
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
|
+
exports.directiveTag = directiveTag;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/graphql-markdown/graphql-markdown/issues"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.10",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"docs": "typedoc"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@graphql-markdown/graphql": "^1.1.
|
|
60
|
-
"@graphql-markdown/utils": "^1.8.
|
|
59
|
+
"@graphql-markdown/graphql": "^1.1.7",
|
|
60
|
+
"@graphql-markdown/utils": "^1.8.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"graphql": "^16.0"
|