@graphql-markdown/printer-legacy 1.5.0 → 1.5.1
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.
- package/dist/graphql/input.js +3 -1
- package/dist/graphql/interface.js +3 -1
- package/dist/graphql/object.js +9 -3
- package/dist/graphql/union.js +3 -1
- package/dist/printer.d.ts +2 -1
- package/dist/printer.js +4 -2
- package/package.json +3 -3
package/dist/graphql/input.js
CHANGED
|
@@ -3,5 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.printCodeInput = exports.printInputMetadata = void 0;
|
|
4
4
|
const object_1 = require("./object");
|
|
5
5
|
exports.printInputMetadata = object_1.printObjectMetadata;
|
|
6
|
-
const printCodeInput = (type, options) =>
|
|
6
|
+
const printCodeInput = (type, options) => {
|
|
7
|
+
return (0, object_1.printCodeType)(type, "input", options);
|
|
8
|
+
};
|
|
7
9
|
exports.printCodeInput = printCodeInput;
|
|
@@ -3,5 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.printCodeInterface = exports.printInterfaceMetadata = void 0;
|
|
4
4
|
const object_1 = require("./object");
|
|
5
5
|
exports.printInterfaceMetadata = object_1.printObjectMetadata;
|
|
6
|
-
const printCodeInterface = (type, options) =>
|
|
6
|
+
const printCodeInterface = (type, options) => {
|
|
7
|
+
return (0, object_1.printCodeType)(type, "interface", options);
|
|
8
|
+
};
|
|
7
9
|
exports.printCodeInterface = printCodeInterface;
|
package/dist/graphql/object.js
CHANGED
|
@@ -30,7 +30,9 @@ const printCodeType = (type, entity, options) => {
|
|
|
30
30
|
type.getInterfaces().length > 0
|
|
31
31
|
? ` implements ${type
|
|
32
32
|
.getInterfaces()
|
|
33
|
-
.map((field) =>
|
|
33
|
+
.map((field) => {
|
|
34
|
+
return (0, graphql_1.getTypeName)(field);
|
|
35
|
+
})
|
|
34
36
|
.join(", ")}`
|
|
35
37
|
: "";
|
|
36
38
|
const typeFields = (0, graphql_1.getFields)(type)
|
|
@@ -38,10 +40,14 @@ const printCodeType = (type, entity, options) => {
|
|
|
38
40
|
const f = (0, code_1.printCodeField)(field, options, 1);
|
|
39
41
|
return f.length > 0 ? `${strings_1.MARKDOWN_CODE_INDENTATION}${f}` : "";
|
|
40
42
|
})
|
|
41
|
-
.filter((field) =>
|
|
43
|
+
.filter((field) => {
|
|
44
|
+
return field.length > 0;
|
|
45
|
+
})
|
|
42
46
|
.join("");
|
|
43
47
|
return `${entity} ${name}${extendsInterface} {${strings_1.MARKDOWN_EOL}${typeFields}}`;
|
|
44
48
|
};
|
|
45
49
|
exports.printCodeType = printCodeType;
|
|
46
|
-
const printCodeObject = (type, options) =>
|
|
50
|
+
const printCodeObject = (type, options) => {
|
|
51
|
+
return (0, exports.printCodeType)(type, "type", options);
|
|
52
|
+
};
|
|
47
53
|
exports.printCodeObject = printCodeObject;
|
package/dist/graphql/union.js
CHANGED
|
@@ -20,7 +20,9 @@ const printCodeUnion = (type, options) => {
|
|
|
20
20
|
let code = `union ${(0, graphql_1.getTypeName)(type)} = `;
|
|
21
21
|
code += type
|
|
22
22
|
.getTypes()
|
|
23
|
-
.map((v) =>
|
|
23
|
+
.map((v) => {
|
|
24
|
+
return (0, graphql_1.getTypeName)(v);
|
|
25
|
+
})
|
|
24
26
|
.join(" | ");
|
|
25
27
|
return code;
|
|
26
28
|
};
|
package/dist/printer.d.ts
CHANGED
|
@@ -4,13 +4,14 @@ export declare class Printer implements IPrinter {
|
|
|
4
4
|
static printDescription: (type: unknown, options?: PrintTypeOptions | undefined, noText?: string | undefined) => string | MDXString;
|
|
5
5
|
static printCustomDirectives: (type: unknown, options: PrintTypeOptions) => string;
|
|
6
6
|
static printCustomTags: (type: unknown, options: PrintTypeOptions) => string | MDXString;
|
|
7
|
-
static init(schema: Maybe<GraphQLSchema>, baseURL?: Maybe<string>, linkRoot?: Maybe<string>, { customDirectives, groups, onlyDocDirectives, printTypeOptions, skipDocDirectives, }?: {
|
|
7
|
+
static init(schema: Maybe<GraphQLSchema>, baseURL?: Maybe<string>, linkRoot?: Maybe<string>, { customDirectives, groups, onlyDocDirectives, printTypeOptions, skipDocDirectives, metatags, }?: {
|
|
8
8
|
customDirectives?: CustomDirectiveMap;
|
|
9
9
|
deprecated?: TypeDeprecatedOption;
|
|
10
10
|
groups?: SchemaEntitiesGroupMap;
|
|
11
11
|
onlyDocDirectives?: GraphQLDirective[];
|
|
12
12
|
printTypeOptions?: PrinterConfigPrintTypeOptions;
|
|
13
13
|
skipDocDirectives?: GraphQLDirective[];
|
|
14
|
+
metatags?: Record<string, string>[];
|
|
14
15
|
}): void;
|
|
15
16
|
static printHeader: (id: string, title: string, options: PrintTypeOptions) => string;
|
|
16
17
|
static printCode: (type: unknown, options: PrintTypeOptions) => string;
|
package/dist/printer.js
CHANGED
|
@@ -15,12 +15,13 @@ class Printer {
|
|
|
15
15
|
static printDescription = common_1.printDescription;
|
|
16
16
|
static printCustomDirectives = directive_1.printCustomDirectives;
|
|
17
17
|
static printCustomTags = directive_1.printCustomTags;
|
|
18
|
-
static init(schema, baseURL = "schema", linkRoot = "/", { customDirectives, groups, onlyDocDirectives, printTypeOptions, skipDocDirectives, } = {
|
|
18
|
+
static init(schema, baseURL = "schema", linkRoot = "/", { customDirectives, groups, onlyDocDirectives, printTypeOptions, skipDocDirectives, metatags, } = {
|
|
19
19
|
customDirectives: undefined,
|
|
20
20
|
groups: undefined,
|
|
21
21
|
onlyDocDirectives: [],
|
|
22
22
|
printTypeOptions: options_1.PRINT_TYPE_DEFAULT_OPTIONS,
|
|
23
23
|
skipDocDirectives: [],
|
|
24
|
+
metatags: [],
|
|
24
25
|
}) {
|
|
25
26
|
if (typeof Printer.options !== "undefined") {
|
|
26
27
|
return;
|
|
@@ -40,6 +41,7 @@ class Printer {
|
|
|
40
41
|
onlyDocDirectives: onlyDocDirectives ?? [],
|
|
41
42
|
skipDocDirectives: skipDocDirectives ?? [],
|
|
42
43
|
typeBadges: printTypeOptions?.typeBadges ?? options_1.PRINT_TYPE_DEFAULT_OPTIONS.typeBadges,
|
|
44
|
+
metatags: metatags ?? [],
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
static printHeader = (id, title, options) => {
|
|
@@ -152,8 +154,8 @@ class Printer {
|
|
|
152
154
|
const relations = Printer.printRelations(type, printTypeOptions);
|
|
153
155
|
return [
|
|
154
156
|
header,
|
|
155
|
-
mdx_1.mdx,
|
|
156
157
|
metatags,
|
|
158
|
+
mdx_1.mdx,
|
|
157
159
|
tags,
|
|
158
160
|
description,
|
|
159
161
|
code,
|
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.5.
|
|
8
|
+
"version": "1.5.1",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"clean": "rm -rf ./dist"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@graphql-markdown/graphql": "^1.0.
|
|
59
|
-
"@graphql-markdown/utils": "^1.6.
|
|
58
|
+
"@graphql-markdown/graphql": "^1.0.1",
|
|
59
|
+
"@graphql-markdown/utils": "^1.6.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@graphql-markdown/types": "^1.0.0"
|