@graphql-eslint/eslint-plugin 4.0.0-alpha-20230801163310-8bc4340 → 4.0.0-alpha-20230810160036-304c2c0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/cjs/cache.js +10 -19
- package/cjs/configs/index.d.ts +42 -16
- package/cjs/configs/index.js +10 -19
- package/cjs/configs/operations-all.d.ts +4 -3
- package/cjs/configs/operations-all.js +5 -4
- package/cjs/configs/operations-recommended.d.ts +3 -1
- package/cjs/configs/operations-recommended.js +3 -1
- package/cjs/configs/schema-all.d.ts +6 -1
- package/cjs/configs/schema-all.js +5 -2
- package/cjs/configs/schema-recommended.d.ts +19 -1
- package/cjs/configs/schema-recommended.js +22 -2
- package/cjs/documents.js +17 -32
- package/cjs/estree-converter/converter.js +14 -27
- package/cjs/estree-converter/index.js +4 -7
- package/cjs/estree-converter/types.js +3 -5
- package/cjs/estree-converter/utils.d.ts +2 -3
- package/cjs/estree-converter/utils.js +15 -45
- package/cjs/flat-configs.d.ts +59 -12
- package/cjs/flat-configs.js +9 -14
- package/cjs/graphql-config.d.ts +4 -3
- package/cjs/graphql-config.js +23 -44
- package/cjs/index.d.ts +10 -4
- package/cjs/index.js +8 -16
- package/cjs/parser.d.ts +4 -3
- package/cjs/parser.js +38 -45
- package/cjs/processor.d.ts +5 -1
- package/cjs/processor.js +25 -57
- package/cjs/rules/alphabetize.d.ts +6 -16
- package/cjs/rules/alphabetize.js +60 -132
- package/cjs/rules/description-style.d.ts +4 -3
- package/cjs/rules/description-style.js +11 -18
- package/cjs/rules/graphql-js-validation.d.ts +4 -3
- package/cjs/rules/graphql-js-validation.js +151 -225
- package/cjs/rules/index.d.ts +15 -13
- package/cjs/rules/index.js +8 -45
- package/cjs/rules/input-name.d.ts +4 -3
- package/cjs/rules/input-name.js +43 -59
- package/cjs/rules/lone-executable-definition.d.ts +6 -5
- package/cjs/rules/lone-executable-definition.js +14 -28
- package/cjs/rules/match-document-filename.d.ts +4 -3
- package/cjs/rules/match-document-filename.js +39 -70
- package/cjs/rules/naming-convention.d.ts +4 -3
- package/cjs/rules/naming-convention.js +56 -74
- package/cjs/rules/no-anonymous-operations.d.ts +4 -3
- package/cjs/rules/no-anonymous-operations.js +11 -18
- package/cjs/rules/no-deprecated.d.ts +4 -3
- package/cjs/rules/no-deprecated.js +15 -29
- package/cjs/rules/no-duplicate-fields.d.ts +4 -3
- package/cjs/rules/no-duplicate-fields.js +13 -23
- package/cjs/rules/no-hashtag-description.d.ts +4 -3
- package/cjs/rules/no-hashtag-description.js +16 -29
- package/cjs/rules/no-one-place-fragments.d.ts +4 -3
- package/cjs/rules/no-one-place-fragments.js +17 -29
- package/cjs/rules/no-root-type.d.ts +4 -3
- package/cjs/rules/no-root-type.js +15 -25
- package/cjs/rules/no-scalar-result-type-on-mutation.d.ts +4 -3
- package/cjs/rules/no-scalar-result-type-on-mutation.js +18 -30
- package/cjs/rules/no-typename-prefix.d.ts +4 -3
- package/cjs/rules/no-typename-prefix.js +26 -33
- package/cjs/rules/no-unreachable-types.d.ts +4 -3
- package/cjs/rules/no-unreachable-types.js +25 -47
- package/cjs/rules/no-unused-fields.d.ts +4 -3
- package/cjs/rules/no-unused-fields.js +24 -49
- package/cjs/rules/relay-arguments.d.ts +4 -3
- package/cjs/rules/relay-arguments.js +20 -43
- package/cjs/rules/relay-connection-types.d.ts +4 -3
- package/cjs/rules/relay-connection-types.js +14 -45
- package/cjs/rules/relay-edge-types.d.ts +4 -3
- package/cjs/rules/relay-edge-types.js +48 -99
- package/cjs/rules/relay-page-info.d.ts +4 -3
- package/cjs/rules/relay-page-info.js +21 -44
- package/cjs/rules/require-deprecation-date.d.ts +4 -3
- package/cjs/rules/require-deprecation-date.js +15 -31
- package/cjs/rules/require-deprecation-reason.d.ts +4 -3
- package/cjs/rules/require-deprecation-reason.js +12 -20
- package/cjs/rules/require-description.d.ts +4 -3
- package/cjs/rules/require-description.js +39 -65
- package/cjs/rules/require-field-of-type-query-in-mutation-result.d.ts +4 -3
- package/cjs/rules/require-field-of-type-query-in-mutation-result.js +16 -31
- package/cjs/rules/require-import-fragment.d.ts +4 -3
- package/cjs/rules/require-import-fragment.js +22 -40
- package/cjs/rules/require-nullable-fields-with-oneof.d.ts +4 -3
- package/cjs/rules/require-nullable-fields-with-oneof.js +11 -22
- package/cjs/rules/require-nullable-result-in-root.d.ts +4 -3
- package/cjs/rules/require-nullable-result-in-root.js +34 -44
- package/cjs/rules/{require-id-when-available.d.ts → require-selections.d.ts} +4 -3
- package/cjs/rules/require-selections.js +198 -0
- package/cjs/rules/require-type-pattern-with-oneof.d.ts +4 -3
- package/cjs/rules/require-type-pattern-with-oneof.js +15 -23
- package/cjs/rules/selection-set-depth.d.ts +4 -3
- package/cjs/rules/selection-set-depth.js +18 -34
- package/cjs/rules/strict-id-in-types.d.ts +4 -3
- package/cjs/rules/strict-id-in-types.js +25 -43
- package/cjs/rules/{no-case-insensitive-enum-values-duplicates.d.ts → unique-enum-value-names.d.ts} +4 -3
- package/cjs/rules/{no-case-insensitive-enum-values-duplicates.js → unique-enum-value-names.js} +16 -21
- package/cjs/rules/unique-fragment-name.d.ts +3 -2
- package/cjs/rules/unique-fragment-name.js +24 -36
- package/cjs/rules/unique-operation-name.d.ts +4 -3
- package/cjs/rules/unique-operation-name.js +10 -12
- package/cjs/schema.d.ts +4 -3
- package/cjs/schema.js +14 -27
- package/cjs/siblings.d.ts +24 -8
- package/cjs/siblings.js +42 -82
- package/cjs/types.d.ts +74 -7
- package/cjs/types.js +3 -5
- package/cjs/utils.d.ts +3 -2
- package/cjs/utils.js +27 -44
- package/esm/cache.js +4 -8
- package/esm/{chunk-BMTV3EA2.js → chunk-U3TKCM4X.js} +1 -1
- package/esm/configs/index.d.mts +42 -16
- package/esm/configs/index.js +4 -4
- package/esm/configs/operations-all.d.mts +4 -3
- package/esm/configs/operations-all.js +6 -5
- package/esm/configs/operations-recommended.d.mts +3 -1
- package/esm/configs/operations-recommended.js +4 -2
- package/esm/configs/schema-all.d.mts +6 -1
- package/esm/configs/schema-all.js +6 -3
- package/esm/configs/schema-recommended.d.mts +19 -1
- package/esm/configs/schema-recommended.js +23 -3
- package/esm/configs/{relay.js → schema-relay.js} +4 -4
- package/esm/documents.js +10 -17
- package/esm/estree-converter/converter.js +9 -18
- package/esm/estree-converter/utils.d.mts +2 -3
- package/esm/estree-converter/utils.js +11 -38
- package/esm/flat-configs.d.mts +59 -12
- package/esm/flat-configs.js +4 -5
- package/esm/graphql-config.d.mts +4 -3
- package/esm/graphql-config.js +18 -34
- package/esm/index.d.mts +10 -4
- package/esm/index.js +1 -1
- package/esm/parser.d.mts +4 -3
- package/esm/parser.js +33 -27
- package/esm/processor.d.mts +5 -1
- package/esm/processor.js +21 -46
- package/esm/rules/alphabetize.d.mts +6 -16
- package/esm/rules/alphabetize.js +53 -118
- package/esm/rules/description-style.d.mts +4 -3
- package/esm/rules/description-style.js +7 -11
- package/esm/rules/graphql-js-validation.d.mts +4 -3
- package/esm/rules/graphql-js-validation.js +178 -218
- package/esm/rules/index.d.mts +15 -13
- package/esm/rules/index.js +5 -5
- package/esm/rules/input-name.d.mts +4 -3
- package/esm/rules/input-name.js +39 -52
- package/esm/rules/lone-executable-definition.d.mts +6 -5
- package/esm/rules/lone-executable-definition.js +10 -20
- package/esm/rules/match-document-filename.d.mts +4 -3
- package/esm/rules/match-document-filename.js +35 -61
- package/esm/rules/naming-convention.d.mts +4 -3
- package/esm/rules/naming-convention.js +51 -65
- package/esm/rules/no-anonymous-operations.d.mts +4 -3
- package/esm/rules/no-anonymous-operations.js +6 -9
- package/esm/rules/no-deprecated.d.mts +4 -3
- package/esm/rules/no-deprecated.js +10 -20
- package/esm/rules/no-duplicate-fields.d.mts +4 -3
- package/esm/rules/no-duplicate-fields.js +9 -16
- package/esm/rules/no-hashtag-description.d.mts +4 -3
- package/esm/rules/no-hashtag-description.js +11 -20
- package/esm/rules/no-one-place-fragments.d.mts +4 -3
- package/esm/rules/no-one-place-fragments.js +12 -19
- package/esm/rules/no-root-type.d.mts +4 -3
- package/esm/rules/no-root-type.js +11 -18
- package/esm/rules/no-scalar-result-type-on-mutation.d.mts +4 -3
- package/esm/rules/no-scalar-result-type-on-mutation.js +13 -21
- package/esm/rules/no-typename-prefix.d.mts +4 -3
- package/esm/rules/no-typename-prefix.js +22 -26
- package/esm/rules/no-unreachable-types.d.mts +4 -3
- package/esm/rules/no-unreachable-types.js +18 -33
- package/esm/rules/no-unused-fields.d.mts +4 -3
- package/esm/rules/no-unused-fields.js +19 -40
- package/esm/rules/relay-arguments.d.mts +4 -3
- package/esm/rules/relay-arguments.js +15 -34
- package/esm/rules/relay-connection-types.d.mts +4 -3
- package/esm/rules/relay-connection-types.js +10 -38
- package/esm/rules/relay-edge-types.d.mts +4 -3
- package/esm/rules/relay-edge-types.js +43 -89
- package/esm/rules/relay-page-info.d.mts +4 -3
- package/esm/rules/relay-page-info.js +16 -34
- package/esm/rules/require-deprecation-date.d.mts +4 -3
- package/esm/rules/require-deprecation-date.js +10 -22
- package/esm/rules/require-deprecation-reason.d.mts +4 -3
- package/esm/rules/require-deprecation-reason.js +7 -11
- package/esm/rules/require-description.d.mts +4 -3
- package/esm/rules/require-description.js +34 -55
- package/esm/rules/require-field-of-type-query-in-mutation-result.d.mts +4 -3
- package/esm/rules/require-field-of-type-query-in-mutation-result.js +11 -22
- package/esm/rules/require-import-fragment.d.mts +4 -3
- package/esm/rules/require-import-fragment.js +14 -26
- package/esm/rules/require-nullable-fields-with-oneof.d.mts +4 -3
- package/esm/rules/require-nullable-fields-with-oneof.js +6 -13
- package/esm/rules/require-nullable-result-in-root.d.mts +4 -3
- package/esm/rules/require-nullable-result-in-root.js +29 -35
- package/esm/rules/{require-id-when-available.d.mts → require-selections.d.mts} +4 -3
- package/esm/rules/{require-id-when-available.js → require-selections.js} +43 -80
- package/esm/rules/require-type-pattern-with-oneof.d.mts +4 -3
- package/esm/rules/require-type-pattern-with-oneof.js +11 -16
- package/esm/rules/selection-set-depth.d.mts +4 -3
- package/esm/rules/selection-set-depth.js +11 -20
- package/esm/rules/strict-id-in-types.d.mts +4 -3
- package/esm/rules/strict-id-in-types.js +20 -34
- package/esm/rules/{no-case-insensitive-enum-values-duplicates.d.mts → unique-enum-value-names.d.mts} +4 -3
- package/esm/rules/{no-case-insensitive-enum-values-duplicates.js → unique-enum-value-names.js} +8 -9
- package/esm/rules/unique-fragment-name.d.mts +3 -2
- package/esm/rules/unique-fragment-name.js +20 -27
- package/esm/rules/unique-operation-name.d.mts +4 -3
- package/esm/rules/unique-operation-name.js +6 -5
- package/esm/schema.d.mts +4 -3
- package/esm/schema.js +7 -12
- package/esm/siblings.d.mts +24 -8
- package/esm/siblings.js +37 -73
- package/esm/types.d.mts +74 -7
- package/esm/utils.d.mts +3 -2
- package/esm/utils.js +20 -31
- package/index.browser.mjs +5323 -0
- package/package.json +8 -13
- package/cjs/rules/require-id-when-available.js +0 -241
- package/cjs/types-8d5f4ae0.d.ts +0 -107
- package/esm/types-ace77d86.d.ts +0 -107
- /package/cjs/configs/{relay.d.ts → schema-relay.d.ts} +0 -0
- /package/cjs/configs/{relay.js → schema-relay.js} +0 -0
- /package/esm/configs/{relay.d.mts → schema-relay.d.mts} +0 -0
package/README.md
CHANGED
package/cjs/cache.js
CHANGED
@@ -3,18 +3,14 @@ var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable:
|
11
|
-
}
|
12
|
-
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
14
12
|
for (let key of __getOwnPropNames(from))
|
15
|
-
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
14
|
return to;
|
19
15
|
};
|
20
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
@@ -22,10 +18,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
22
18
|
// file that has been converted to a CommonJS file using a Babel-
|
23
19
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
20
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable:
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
26
22
|
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
29
24
|
var cache_exports = {};
|
30
25
|
__export(cache_exports, {
|
31
26
|
ModuleCache: () => ModuleCache
|
@@ -34,12 +29,9 @@ module.exports = __toCommonJS(cache_exports);
|
|
34
29
|
var import_debug = __toESM(require("debug"));
|
35
30
|
const log = (0, import_debug.default)("graphql-eslint:ModuleCache");
|
36
31
|
class ModuleCache {
|
37
|
-
|
38
|
-
this.map = /* @__PURE__ */ new Map();
|
39
|
-
}
|
32
|
+
map = /* @__PURE__ */ new Map();
|
40
33
|
set(cacheKey, result) {
|
41
|
-
this.map.set(cacheKey, { lastSeen: process.hrtime(), result });
|
42
|
-
log("setting entry for", cacheKey);
|
34
|
+
this.map.set(cacheKey, { lastSeen: process.hrtime(), result }), log("setting entry for", cacheKey);
|
43
35
|
}
|
44
36
|
get(cacheKey, settings = {
|
45
37
|
lifetime: 10
|
@@ -51,9 +43,8 @@ class ModuleCache {
|
|
51
43
|
return;
|
52
44
|
}
|
53
45
|
const { lastSeen, result } = value;
|
54
|
-
if (process.env.NODE || process.hrtime(lastSeen)[0] < settings.lifetime)
|
46
|
+
if (process.env.NODE || process.hrtime(lastSeen)[0] < settings.lifetime)
|
55
47
|
return result;
|
56
|
-
}
|
57
48
|
}
|
58
49
|
}
|
59
50
|
// Annotate the CommonJS export names for ESM import in node:
|
package/cjs/configs/index.d.ts
CHANGED
@@ -27,20 +27,38 @@ declare const configs: {
|
|
27
27
|
forbiddenPrefixes: string[];
|
28
28
|
forbiddenSuffixes: string[];
|
29
29
|
};
|
30
|
+
'EnumTypeDefinition,EnumTypeExtension': {
|
31
|
+
forbiddenPrefixes: string[];
|
32
|
+
forbiddenSuffixes: string[];
|
33
|
+
};
|
34
|
+
'InterfaceTypeDefinition,InterfaceTypeExtension': {
|
35
|
+
forbiddenPrefixes: string[];
|
36
|
+
forbiddenSuffixes: string[];
|
37
|
+
};
|
38
|
+
'UnionTypeDefinition,UnionTypeExtension': {
|
39
|
+
forbiddenPrefixes: string[];
|
40
|
+
forbiddenSuffixes: string[];
|
41
|
+
};
|
42
|
+
'ObjectTypeDefinition,ObjectTypeExtension': {
|
43
|
+
forbiddenPrefixes: string[];
|
44
|
+
forbiddenSuffixes: string[];
|
45
|
+
};
|
30
46
|
})[];
|
31
|
-
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': string;
|
32
47
|
'@graphql-eslint/no-hashtag-description': string;
|
33
48
|
'@graphql-eslint/no-typename-prefix': string;
|
34
49
|
'@graphql-eslint/no-unreachable-types': string;
|
50
|
+
'@graphql-eslint/possible-type-extension': string;
|
35
51
|
'@graphql-eslint/provided-required-arguments': string;
|
36
52
|
'@graphql-eslint/require-deprecation-reason': string;
|
37
53
|
'@graphql-eslint/require-description': (string | {
|
38
54
|
types: boolean;
|
39
55
|
DirectiveDefinition: boolean;
|
56
|
+
rootField: boolean;
|
40
57
|
})[];
|
41
58
|
'@graphql-eslint/strict-id-in-types': string;
|
42
59
|
'@graphql-eslint/unique-directive-names': string;
|
43
60
|
'@graphql-eslint/unique-directive-names-per-location': string;
|
61
|
+
'@graphql-eslint/unique-enum-value-names': string;
|
44
62
|
'@graphql-eslint/unique-field-definition-names': string;
|
45
63
|
'@graphql-eslint/unique-operation-types': string;
|
46
64
|
'@graphql-eslint/unique-type-names': string;
|
@@ -50,11 +68,16 @@ declare const configs: {
|
|
50
68
|
extends: string;
|
51
69
|
rules: {
|
52
70
|
'@graphql-eslint/alphabetize': (string | {
|
71
|
+
definitions: boolean;
|
53
72
|
fields: string[];
|
54
|
-
values:
|
73
|
+
values: boolean;
|
55
74
|
arguments: string[];
|
75
|
+
groups: string[];
|
56
76
|
})[];
|
57
77
|
'@graphql-eslint/input-name': string;
|
78
|
+
'@graphql-eslint/no-root-type': (string | {
|
79
|
+
disallow: string[];
|
80
|
+
})[];
|
58
81
|
'@graphql-eslint/no-scalar-result-type-on-mutation': string;
|
59
82
|
'@graphql-eslint/require-deprecation-date': string;
|
60
83
|
'@graphql-eslint/require-field-of-type-query-in-mutation-result': string;
|
@@ -63,6 +86,16 @@ declare const configs: {
|
|
63
86
|
'@graphql-eslint/require-type-pattern-with-oneof': string;
|
64
87
|
};
|
65
88
|
};
|
89
|
+
'schema-relay': {
|
90
|
+
parser: string;
|
91
|
+
plugins: string[];
|
92
|
+
rules: {
|
93
|
+
'@graphql-eslint/relay-arguments': string;
|
94
|
+
'@graphql-eslint/relay-connection-types': string;
|
95
|
+
'@graphql-eslint/relay-edge-types': string;
|
96
|
+
'@graphql-eslint/relay-page-info': string;
|
97
|
+
};
|
98
|
+
};
|
66
99
|
'operations-recommended': {
|
67
100
|
parser: string;
|
68
101
|
plugins: string[];
|
@@ -99,14 +132,16 @@ declare const configs: {
|
|
99
132
|
'@graphql-eslint/overlapping-fields-can-be-merged': string;
|
100
133
|
'@graphql-eslint/possible-fragment-spread': string;
|
101
134
|
'@graphql-eslint/provided-required-arguments': string;
|
102
|
-
'@graphql-eslint/require-
|
135
|
+
'@graphql-eslint/require-selections': string;
|
103
136
|
'@graphql-eslint/scalar-leafs': string;
|
104
137
|
'@graphql-eslint/selection-set-depth': (string | {
|
105
138
|
maxDepth: number;
|
106
139
|
})[];
|
107
140
|
'@graphql-eslint/unique-argument-names': string;
|
108
141
|
'@graphql-eslint/unique-directive-names-per-location': string;
|
142
|
+
'@graphql-eslint/unique-fragment-name': string;
|
109
143
|
'@graphql-eslint/unique-input-field-names': string;
|
144
|
+
'@graphql-eslint/unique-operation-name': string;
|
110
145
|
'@graphql-eslint/unique-variable-names': string;
|
111
146
|
'@graphql-eslint/value-literals-of-correct-type': string;
|
112
147
|
'@graphql-eslint/variables-are-input-types': string;
|
@@ -117,9 +152,11 @@ declare const configs: {
|
|
117
152
|
extends: string;
|
118
153
|
rules: {
|
119
154
|
'@graphql-eslint/alphabetize': (string | {
|
155
|
+
definitions: boolean;
|
120
156
|
selections: string[];
|
121
|
-
variables:
|
157
|
+
variables: boolean;
|
122
158
|
arguments: string[];
|
159
|
+
groups: string[];
|
123
160
|
})[];
|
124
161
|
'@graphql-eslint/lone-executable-definition': string;
|
125
162
|
'@graphql-eslint/match-document-filename': (string | {
|
@@ -129,18 +166,7 @@ declare const configs: {
|
|
129
166
|
fragment: string;
|
130
167
|
})[];
|
131
168
|
'@graphql-eslint/no-one-place-fragments': string;
|
132
|
-
'@graphql-eslint/
|
133
|
-
'@graphql-eslint/unique-operation-name': string;
|
134
|
-
};
|
135
|
-
};
|
136
|
-
relay: {
|
137
|
-
parser: string;
|
138
|
-
plugins: string[];
|
139
|
-
rules: {
|
140
|
-
'@graphql-eslint/relay-arguments': string;
|
141
|
-
'@graphql-eslint/relay-connection-types': string;
|
142
|
-
'@graphql-eslint/relay-edge-types': string;
|
143
|
-
'@graphql-eslint/relay-page-info': string;
|
169
|
+
'@graphql-eslint/require-import-fragment': string;
|
144
170
|
};
|
145
171
|
};
|
146
172
|
};
|
package/cjs/configs/index.js
CHANGED
@@ -3,18 +3,14 @@ var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable:
|
11
|
-
}
|
12
|
-
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
14
12
|
for (let key of __getOwnPropNames(from))
|
15
|
-
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
14
|
return to;
|
19
15
|
};
|
20
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
@@ -22,26 +18,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
22
18
|
// file that has been converted to a CommonJS file using a Babel-
|
23
19
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
20
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable:
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
26
22
|
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
29
24
|
var configs_exports = {};
|
30
25
|
__export(configs_exports, {
|
31
26
|
configs: () => configs
|
32
27
|
});
|
33
28
|
module.exports = __toCommonJS(configs_exports);
|
34
|
-
var import_operations_all = __toESM(require("./operations-all.js"));
|
35
|
-
var import_operations_recommended = __toESM(require("./operations-recommended.js"));
|
36
|
-
var import_relay = __toESM(require("./relay.js"));
|
37
|
-
var import_schema_all = __toESM(require("./schema-all.js"));
|
38
|
-
var import_schema_recommended = __toESM(require("./schema-recommended.js"));
|
29
|
+
var import_operations_all = __toESM(require("./operations-all.js")), import_operations_recommended = __toESM(require("./operations-recommended.js")), import_schema_all = __toESM(require("./schema-all.js")), import_schema_recommended = __toESM(require("./schema-recommended.js")), import_schema_relay = __toESM(require("./schema-relay.js"));
|
39
30
|
const configs = {
|
40
31
|
"schema-recommended": import_schema_recommended.default,
|
41
32
|
"schema-all": import_schema_all.default,
|
33
|
+
"schema-relay": import_schema_relay.default,
|
42
34
|
"operations-recommended": import_operations_recommended.default,
|
43
|
-
"operations-all": import_operations_all.default
|
44
|
-
relay: import_relay.default
|
35
|
+
"operations-all": import_operations_all.default
|
45
36
|
};
|
46
37
|
// Annotate the CommonJS export names for ESM import in node:
|
47
38
|
0 && (module.exports = {
|
@@ -2,9 +2,11 @@ declare const _default: {
|
|
2
2
|
extends: string;
|
3
3
|
rules: {
|
4
4
|
'@graphql-eslint/alphabetize': (string | {
|
5
|
+
definitions: boolean;
|
5
6
|
selections: string[];
|
6
|
-
variables:
|
7
|
+
variables: boolean;
|
7
8
|
arguments: string[];
|
9
|
+
groups: string[];
|
8
10
|
})[];
|
9
11
|
'@graphql-eslint/lone-executable-definition': string;
|
10
12
|
'@graphql-eslint/match-document-filename': (string | {
|
@@ -14,8 +16,7 @@ declare const _default: {
|
|
14
16
|
fragment: string;
|
15
17
|
})[];
|
16
18
|
'@graphql-eslint/no-one-place-fragments': string;
|
17
|
-
'@graphql-eslint/
|
18
|
-
'@graphql-eslint/unique-operation-name': string;
|
19
|
+
'@graphql-eslint/require-import-fragment': string;
|
19
20
|
};
|
20
21
|
};
|
21
22
|
|
@@ -5,9 +5,11 @@ module.exports = {
|
|
5
5
|
"@graphql-eslint/alphabetize": [
|
6
6
|
"error",
|
7
7
|
{
|
8
|
+
definitions: !0,
|
8
9
|
selections: ["OperationDefinition", "FragmentDefinition"],
|
9
|
-
variables:
|
10
|
-
arguments: ["Field", "Directive"]
|
10
|
+
variables: !0,
|
11
|
+
arguments: ["Field", "Directive"],
|
12
|
+
groups: ["id", "*", "createdAt", "updatedAt"]
|
11
13
|
}
|
12
14
|
],
|
13
15
|
"@graphql-eslint/lone-executable-definition": "error",
|
@@ -21,7 +23,6 @@ module.exports = {
|
|
21
23
|
}
|
22
24
|
],
|
23
25
|
"@graphql-eslint/no-one-place-fragments": "error",
|
24
|
-
"@graphql-eslint/
|
25
|
-
"@graphql-eslint/unique-operation-name": "error"
|
26
|
+
"@graphql-eslint/require-import-fragment": "error"
|
26
27
|
}
|
27
28
|
};
|
@@ -34,14 +34,16 @@ declare const _default: {
|
|
34
34
|
'@graphql-eslint/overlapping-fields-can-be-merged': string;
|
35
35
|
'@graphql-eslint/possible-fragment-spread': string;
|
36
36
|
'@graphql-eslint/provided-required-arguments': string;
|
37
|
-
'@graphql-eslint/require-
|
37
|
+
'@graphql-eslint/require-selections': string;
|
38
38
|
'@graphql-eslint/scalar-leafs': string;
|
39
39
|
'@graphql-eslint/selection-set-depth': (string | {
|
40
40
|
maxDepth: number;
|
41
41
|
})[];
|
42
42
|
'@graphql-eslint/unique-argument-names': string;
|
43
43
|
'@graphql-eslint/unique-directive-names-per-location': string;
|
44
|
+
'@graphql-eslint/unique-fragment-name': string;
|
44
45
|
'@graphql-eslint/unique-input-field-names': string;
|
46
|
+
'@graphql-eslint/unique-operation-name': string;
|
45
47
|
'@graphql-eslint/unique-variable-names': string;
|
46
48
|
'@graphql-eslint/value-literals-of-correct-type': string;
|
47
49
|
'@graphql-eslint/variables-are-input-types': string;
|
@@ -38,12 +38,14 @@ module.exports = {
|
|
38
38
|
"@graphql-eslint/overlapping-fields-can-be-merged": "error",
|
39
39
|
"@graphql-eslint/possible-fragment-spread": "error",
|
40
40
|
"@graphql-eslint/provided-required-arguments": "error",
|
41
|
-
"@graphql-eslint/require-
|
41
|
+
"@graphql-eslint/require-selections": "error",
|
42
42
|
"@graphql-eslint/scalar-leafs": "error",
|
43
43
|
"@graphql-eslint/selection-set-depth": ["error", { maxDepth: 7 }],
|
44
44
|
"@graphql-eslint/unique-argument-names": "error",
|
45
45
|
"@graphql-eslint/unique-directive-names-per-location": "error",
|
46
|
+
"@graphql-eslint/unique-fragment-name": "error",
|
46
47
|
"@graphql-eslint/unique-input-field-names": "error",
|
48
|
+
"@graphql-eslint/unique-operation-name": "error",
|
47
49
|
"@graphql-eslint/unique-variable-names": "error",
|
48
50
|
"@graphql-eslint/value-literals-of-correct-type": "error",
|
49
51
|
"@graphql-eslint/variables-are-input-types": "error",
|
@@ -2,11 +2,16 @@ declare const _default: {
|
|
2
2
|
extends: string;
|
3
3
|
rules: {
|
4
4
|
'@graphql-eslint/alphabetize': (string | {
|
5
|
+
definitions: boolean;
|
5
6
|
fields: string[];
|
6
|
-
values:
|
7
|
+
values: boolean;
|
7
8
|
arguments: string[];
|
9
|
+
groups: string[];
|
8
10
|
})[];
|
9
11
|
'@graphql-eslint/input-name': string;
|
12
|
+
'@graphql-eslint/no-root-type': (string | {
|
13
|
+
disallow: string[];
|
14
|
+
})[];
|
10
15
|
'@graphql-eslint/no-scalar-result-type-on-mutation': string;
|
11
16
|
'@graphql-eslint/require-deprecation-date': string;
|
12
17
|
'@graphql-eslint/require-field-of-type-query-in-mutation-result': string;
|
@@ -5,12 +5,15 @@ module.exports = {
|
|
5
5
|
"@graphql-eslint/alphabetize": [
|
6
6
|
"error",
|
7
7
|
{
|
8
|
+
definitions: !0,
|
8
9
|
fields: ["ObjectTypeDefinition", "InterfaceTypeDefinition", "InputObjectTypeDefinition"],
|
9
|
-
values:
|
10
|
-
arguments: ["FieldDefinition", "Field", "DirectiveDefinition", "Directive"]
|
10
|
+
values: !0,
|
11
|
+
arguments: ["FieldDefinition", "Field", "DirectiveDefinition", "Directive"],
|
12
|
+
groups: ["id", "*", "createdAt", "updatedAt"]
|
11
13
|
}
|
12
14
|
],
|
13
15
|
"@graphql-eslint/input-name": "error",
|
16
|
+
"@graphql-eslint/no-root-type": ["error", { disallow: ["mutation", "subscription"] }],
|
14
17
|
"@graphql-eslint/no-scalar-result-type-on-mutation": "error",
|
15
18
|
"@graphql-eslint/require-deprecation-date": "error",
|
16
19
|
"@graphql-eslint/require-field-of-type-query-in-mutation-result": "error",
|
@@ -26,20 +26,38 @@ declare const _default: {
|
|
26
26
|
forbiddenPrefixes: string[];
|
27
27
|
forbiddenSuffixes: string[];
|
28
28
|
};
|
29
|
+
'EnumTypeDefinition,EnumTypeExtension': {
|
30
|
+
forbiddenPrefixes: string[];
|
31
|
+
forbiddenSuffixes: string[];
|
32
|
+
};
|
33
|
+
'InterfaceTypeDefinition,InterfaceTypeExtension': {
|
34
|
+
forbiddenPrefixes: string[];
|
35
|
+
forbiddenSuffixes: string[];
|
36
|
+
};
|
37
|
+
'UnionTypeDefinition,UnionTypeExtension': {
|
38
|
+
forbiddenPrefixes: string[];
|
39
|
+
forbiddenSuffixes: string[];
|
40
|
+
};
|
41
|
+
'ObjectTypeDefinition,ObjectTypeExtension': {
|
42
|
+
forbiddenPrefixes: string[];
|
43
|
+
forbiddenSuffixes: string[];
|
44
|
+
};
|
29
45
|
})[];
|
30
|
-
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': string;
|
31
46
|
'@graphql-eslint/no-hashtag-description': string;
|
32
47
|
'@graphql-eslint/no-typename-prefix': string;
|
33
48
|
'@graphql-eslint/no-unreachable-types': string;
|
49
|
+
'@graphql-eslint/possible-type-extension': string;
|
34
50
|
'@graphql-eslint/provided-required-arguments': string;
|
35
51
|
'@graphql-eslint/require-deprecation-reason': string;
|
36
52
|
'@graphql-eslint/require-description': (string | {
|
37
53
|
types: boolean;
|
38
54
|
DirectiveDefinition: boolean;
|
55
|
+
rootField: boolean;
|
39
56
|
})[];
|
40
57
|
'@graphql-eslint/strict-id-in-types': string;
|
41
58
|
'@graphql-eslint/unique-directive-names': string;
|
42
59
|
'@graphql-eslint/unique-directive-names-per-location': string;
|
60
|
+
'@graphql-eslint/unique-enum-value-names': string;
|
43
61
|
'@graphql-eslint/unique-field-definition-names': string;
|
44
62
|
'@graphql-eslint/unique-operation-types': string;
|
45
63
|
'@graphql-eslint/unique-type-names': string;
|
@@ -28,19 +28,39 @@ module.exports = {
|
|
28
28
|
"FieldDefinition[parent.name.value=Subscription]": {
|
29
29
|
forbiddenPrefixes: ["subscription"],
|
30
30
|
forbiddenSuffixes: ["Subscription"]
|
31
|
+
},
|
32
|
+
"EnumTypeDefinition,EnumTypeExtension": {
|
33
|
+
forbiddenPrefixes: ["Enum"],
|
34
|
+
forbiddenSuffixes: ["Enum"]
|
35
|
+
},
|
36
|
+
"InterfaceTypeDefinition,InterfaceTypeExtension": {
|
37
|
+
forbiddenPrefixes: ["Interface"],
|
38
|
+
forbiddenSuffixes: ["Interface"]
|
39
|
+
},
|
40
|
+
"UnionTypeDefinition,UnionTypeExtension": {
|
41
|
+
forbiddenPrefixes: ["Union"],
|
42
|
+
forbiddenSuffixes: ["Union"]
|
43
|
+
},
|
44
|
+
"ObjectTypeDefinition,ObjectTypeExtension": {
|
45
|
+
forbiddenPrefixes: ["Type"],
|
46
|
+
forbiddenSuffixes: ["Type"]
|
31
47
|
}
|
32
48
|
}
|
33
49
|
],
|
34
|
-
"@graphql-eslint/no-case-insensitive-enum-values-duplicates": "error",
|
35
50
|
"@graphql-eslint/no-hashtag-description": "error",
|
36
51
|
"@graphql-eslint/no-typename-prefix": "error",
|
37
52
|
"@graphql-eslint/no-unreachable-types": "error",
|
53
|
+
"@graphql-eslint/possible-type-extension": "error",
|
38
54
|
"@graphql-eslint/provided-required-arguments": "error",
|
39
55
|
"@graphql-eslint/require-deprecation-reason": "error",
|
40
|
-
"@graphql-eslint/require-description": [
|
56
|
+
"@graphql-eslint/require-description": [
|
57
|
+
"error",
|
58
|
+
{ types: !0, DirectiveDefinition: !0, rootField: !0 }
|
59
|
+
],
|
41
60
|
"@graphql-eslint/strict-id-in-types": "error",
|
42
61
|
"@graphql-eslint/unique-directive-names": "error",
|
43
62
|
"@graphql-eslint/unique-directive-names-per-location": "error",
|
63
|
+
"@graphql-eslint/unique-enum-value-names": "error",
|
44
64
|
"@graphql-eslint/unique-field-definition-names": "error",
|
45
65
|
"@graphql-eslint/unique-operation-types": "error",
|
46
66
|
"@graphql-eslint/unique-type-names": "error"
|
package/cjs/documents.js
CHANGED
@@ -3,18 +3,14 @@ var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable:
|
11
|
-
}
|
12
|
-
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
14
12
|
for (let key of __getOwnPropNames(from))
|
15
|
-
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
14
|
return to;
|
19
15
|
};
|
20
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
@@ -22,56 +18,45 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
22
18
|
// file that has been converted to a CommonJS file using a Babel-
|
23
19
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
20
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable:
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
26
22
|
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
29
24
|
var documents_exports = {};
|
30
25
|
__export(documents_exports, {
|
31
26
|
getDocuments: () => getDocuments
|
32
27
|
});
|
33
28
|
module.exports = __toCommonJS(documents_exports);
|
34
|
-
var
|
35
|
-
|
36
|
-
var import_fast_glob = __toESM(require("fast-glob"));
|
37
|
-
var import_cache = require("./cache.js");
|
38
|
-
const debug = (0, import_debug.default)("graphql-eslint:operations");
|
39
|
-
const operationsCache = new import_cache.ModuleCache();
|
40
|
-
const handleVirtualPath = (documents) => {
|
29
|
+
var import_node_path = require("node:path"), import_debug = __toESM(require("debug")), import_fast_glob = __toESM(require("fast-glob")), import_cache = require("./cache.js");
|
30
|
+
const debug = (0, import_debug.default)("graphql-eslint:operations"), operationsCache = new import_cache.ModuleCache(), handleVirtualPath = (documents) => {
|
41
31
|
const filepathMap = /* @__PURE__ */ Object.create(null);
|
42
32
|
return documents.map((source) => {
|
43
|
-
var _a;
|
44
33
|
const location = source.location;
|
45
|
-
if ([".gql", ".graphql"].some((extension) => location.endsWith(extension)))
|
34
|
+
if ([".gql", ".graphql"].some((extension) => location.endsWith(extension)))
|
46
35
|
return source;
|
47
|
-
|
48
|
-
(_a = filepathMap[location]) != null ? _a : filepathMap[location] = -1;
|
36
|
+
filepathMap[location] ??= -1;
|
49
37
|
const index = filepathMap[location] += 1;
|
50
38
|
return {
|
51
39
|
...source,
|
52
|
-
location: (0,
|
40
|
+
location: (0, import_node_path.resolve)(location, `${index}_document.graphql`)
|
53
41
|
};
|
54
42
|
});
|
55
|
-
}
|
56
|
-
const getDocuments = (project) => {
|
43
|
+
}, getDocuments = (project) => {
|
57
44
|
const documentsKey = project.documents;
|
58
|
-
if (!documentsKey)
|
45
|
+
if (!documentsKey)
|
59
46
|
return [];
|
60
|
-
}
|
61
47
|
let siblings = operationsCache.get(documentsKey);
|
62
48
|
if (!siblings) {
|
63
49
|
debug("Loading operations from %o", project.documents);
|
64
50
|
const documents = project.loadDocumentsSync(project.documents, {
|
65
|
-
skipGraphQLImport:
|
51
|
+
skipGraphQLImport: !0,
|
66
52
|
pluckConfig: project.extensions.pluckConfig
|
67
53
|
});
|
68
54
|
if (debug.enabled) {
|
69
55
|
debug("Loaded %d operations", documents.length);
|
70
|
-
const operationsPaths = import_fast_glob.default.sync(project.documents, { absolute:
|
56
|
+
const operationsPaths = import_fast_glob.default.sync(project.documents, { absolute: !0 });
|
71
57
|
debug("Operations pointers %O", operationsPaths);
|
72
58
|
}
|
73
|
-
siblings = handleVirtualPath(documents);
|
74
|
-
operationsCache.set(documentsKey, siblings);
|
59
|
+
siblings = handleVirtualPath(documents), operationsCache.set(documentsKey, siblings);
|
75
60
|
}
|
76
61
|
return siblings;
|
77
62
|
};
|
@@ -5,35 +5,29 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
6
|
var __export = (target, all) => {
|
7
7
|
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
9
|
-
}
|
10
|
-
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
12
11
|
for (let key of __getOwnPropNames(from))
|
13
|
-
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
13
|
return to;
|
17
14
|
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
19
16
|
var converter_exports = {};
|
20
17
|
__export(converter_exports, {
|
21
18
|
convertToESTree: () => convertToESTree
|
22
19
|
});
|
23
20
|
module.exports = __toCommonJS(converter_exports);
|
24
|
-
var import_graphql = require("graphql");
|
25
|
-
var import_utils = require("./utils.js");
|
21
|
+
var import_graphql = require("graphql"), import_utils = require("./utils.js");
|
26
22
|
function convertToESTree(node, schema) {
|
27
|
-
const typeInfo = schema && new import_graphql.TypeInfo(schema)
|
28
|
-
const visitor = {
|
23
|
+
const typeInfo = schema && new import_graphql.TypeInfo(schema), visitor = {
|
29
24
|
leave(node2, key, parent) {
|
30
25
|
const leadingComments = "description" in node2 && node2.description ? [
|
31
26
|
{
|
32
27
|
type: node2.description.block ? "Block" : "Line",
|
33
28
|
value: node2.description.value
|
34
29
|
}
|
35
|
-
] : []
|
36
|
-
const calculatedTypeInfo = typeInfo ? {
|
30
|
+
] : [], calculatedTypeInfo = typeInfo ? {
|
37
31
|
argument: typeInfo.getArgument(),
|
38
32
|
defaultValue: typeInfo.getDefaultValue(),
|
39
33
|
directive: typeInfo.getDirective(),
|
@@ -43,19 +37,12 @@ function convertToESTree(node, schema) {
|
|
43
37
|
parentInputType: typeInfo.getParentInputType(),
|
44
38
|
parentType: typeInfo.getParentType(),
|
45
39
|
gqlType: typeInfo.getType()
|
46
|
-
} : {}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
...node2,
|
53
|
-
definitions: node2.definitions.map(
|
54
|
-
(definition) => definition.rawNode()
|
55
|
-
)
|
56
|
-
} : node2;
|
57
|
-
};
|
58
|
-
const commonFields = {
|
40
|
+
} : {}, rawNode = () => parent && key !== void 0 ? parent[key] : node2.kind === import_graphql.Kind.DOCUMENT ? {
|
41
|
+
...node2,
|
42
|
+
definitions: node2.definitions.map(
|
43
|
+
(definition) => definition.rawNode()
|
44
|
+
)
|
45
|
+
} : node2, commonFields = {
|
59
46
|
...node2,
|
60
47
|
type: node2.kind,
|
61
48
|
loc: (0, import_utils.convertLocation)(node2.loc),
|
@@ -4,15 +4,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
6
|
var __copyProps = (to, from, except, desc) => {
|
7
|
-
if (from && typeof from
|
7
|
+
if (from && typeof from == "object" || typeof from == "function")
|
8
8
|
for (let key of __getOwnPropNames(from))
|
9
|
-
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
-
}
|
9
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
10
|
return to;
|
13
|
-
};
|
14
|
-
var
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
11
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
12
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
16
13
|
var estree_converter_exports = {};
|
17
14
|
module.exports = __toCommonJS(estree_converter_exports);
|
18
15
|
__reExport(estree_converter_exports, require("./converter.js"), module.exports);
|