oxfmt 0.56.0 → 0.58.0
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/{acorn-LGWopQvF.js → acorn-CZllRq2x.js} +1893 -1803
- package/dist/{angular-BbAuvH72.js → angular-CsoDKqo4.js} +1587 -995
- package/dist/{apis-C2fbFQF2.js → apis-DLO0lBDu.js} +4 -4
- package/dist/babel-DZD6u90w.js +9896 -0
- package/dist/{bindings-Ab6hoO7p.js → bindings-DTiEua0g.js} +26 -26
- package/dist/{chunk-DSjvVL_1-DaTvESxp.js → chunk-DSjvVL_1-DX2STy_I.js} +1 -1
- package/dist/cli-worker.d.ts +5 -5
- package/dist/cli-worker.js +1 -1
- package/dist/cli.js +3 -2
- package/dist/{dist-BMp5jzRv.js → dist-YOS4M6hk.js} +17 -17
- package/dist/estree-ChnhgzGg.js +7885 -0
- package/dist/flow-C6LkWPPl.js +9149 -0
- package/dist/{glimmer-Ba_8Z2bG.js → glimmer-YnkKK2a7.js} +204 -187
- package/dist/{graphql-CZ7EPWgo.js → graphql-BNiwkZTo.js} +905 -820
- package/dist/{html-DblM11Xw.js → html-DMHXIbrM.js} +1416 -1305
- package/dist/index.js +3 -3
- package/dist/{jiti-Bb1dT6Cw-DWQc1k7j.js → jiti-Bb1dT6Cw-B61jQmj-.js} +2 -2
- package/dist/markdown-BjyDFyaO.js +14010 -0
- package/dist/{meriyah-DafjRZfO.js → meriyah-zDNCk2o1.js} +1501 -1429
- package/dist/{migrate-prettier-DrYAkU3F.js → migrate-prettier-BmSsy164.js} +49 -42
- package/dist/{plugin-CYEM2898.js → plugin-B4cguZ1l.js} +16 -12
- package/dist/{postcss-CkhtwsAS.js → postcss-CwPwODg8.js} +2153 -2002
- package/dist/{prettier-DKAx5A83.js → prettier-BByt4AhK.js} +5674 -5038
- package/dist/{sorter-BZkvDMjt-c-GMCzH3.js → sorter-BZkvDMjt-B8ihSEiX.js} +7 -7
- package/dist/{sorter-DK1aMCjs.js → sorter-BcGkkjyR.js} +1 -1
- package/dist/{typescript-DaxiA0nr.js → typescript-Bq_S3kyC.js} +10499 -10252
- package/dist/{v3-D-mr2VVh-7G9Y2N0Q.js → v3-D-mr2VVh-p01OHBjH.js} +4 -4
- package/dist/{v4-C-HWEQJm-DKnDZXAs.js → v4-C-HWEQJm-BbuYNtSW.js} +4 -4
- package/dist/yaml-DlyuuZmC.js +6121 -0
- package/package.json +20 -20
- package/dist/babel-DLjwvkt5.js +0 -9884
- package/dist/estree-DbmUPhmV.js +0 -7269
- package/dist/flow-CJbpv7JL.js +0 -52916
- package/dist/markdown-B5hFVJKQ.js +0 -6880
- package/dist/yaml-BC7gw7un.js +0 -5280
|
@@ -1,125 +1,167 @@
|
|
|
1
1
|
import { n as __esmMin } from "./rolldown-runtime-CE-6LUnI.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/prettier@3.
|
|
3
|
-
function
|
|
4
|
-
return
|
|
5
|
-
type:
|
|
2
|
+
//#region ../../node_modules/.pnpm/prettier@3.9.4/node_modules/prettier/plugins/graphql.mjs
|
|
3
|
+
function m(e) {
|
|
4
|
+
return O(e), {
|
|
5
|
+
type: Ie,
|
|
6
6
|
contents: e
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
type:
|
|
9
|
+
function N(e, t = {}) {
|
|
10
|
+
return O(e), J(t.expandedStates, !0), {
|
|
11
|
+
type: ge,
|
|
12
12
|
id: t.id,
|
|
13
13
|
contents: e,
|
|
14
14
|
break: !!t.shouldBreak,
|
|
15
15
|
expandedStates: t.expandedStates
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
type:
|
|
18
|
+
function _(e, t = "", n = {}) {
|
|
19
|
+
return O(e), t !== "" && O(t), {
|
|
20
|
+
type: Se,
|
|
21
21
|
breakContents: e,
|
|
22
22
|
flatContents: t,
|
|
23
23
|
groupId: n.groupId
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function d(e, t) {
|
|
27
|
+
O(e), J(t);
|
|
28
28
|
let n = [];
|
|
29
|
-
for (let
|
|
29
|
+
for (let r = 0; r < t.length; r++) r !== 0 && n.push(e), n.push(t[r]);
|
|
30
30
|
return n;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return (t, n,
|
|
34
|
-
let r = !!i?.backwards;
|
|
32
|
+
function W(e) {
|
|
33
|
+
return (t, n, r) => {
|
|
35
34
|
if (n === !1) return !1;
|
|
36
|
-
let { length: s } = t, a = n;
|
|
35
|
+
let i = !!r?.backwards, { length: s } = t, a = n;
|
|
37
36
|
for (; a >= 0 && a < s;) {
|
|
38
|
-
let
|
|
37
|
+
let p = t.charAt(a);
|
|
39
38
|
if (e instanceof RegExp) {
|
|
40
|
-
if (!e.test(
|
|
41
|
-
} else if (!e.includes(
|
|
42
|
-
|
|
39
|
+
if (!e.test(p)) return a;
|
|
40
|
+
} else if (!e.includes(p)) return a;
|
|
41
|
+
i ? a-- : a++;
|
|
43
42
|
}
|
|
44
43
|
return a === -1 || a === s ? a : !1;
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
|
-
function
|
|
48
|
-
let i = !!n?.backwards;
|
|
46
|
+
function Dt(e, t, n) {
|
|
49
47
|
if (t === !1) return !1;
|
|
50
|
-
let r = e.charAt(t);
|
|
51
|
-
if (
|
|
52
|
-
if (e.charAt(t - 1) === "\r" &&
|
|
48
|
+
let r = !!n?.backwards, i = e.charAt(t);
|
|
49
|
+
if (r) {
|
|
50
|
+
if (e.charAt(t - 1) === "\r" && i === `
|
|
53
51
|
`) return t - 2;
|
|
54
|
-
if (
|
|
52
|
+
if (Ce(i)) return t - 1;
|
|
55
53
|
} else {
|
|
56
|
-
if (
|
|
54
|
+
if (i === "\r" && e.charAt(t + 1) === `
|
|
57
55
|
`) return t + 2;
|
|
58
|
-
if (
|
|
56
|
+
if (Ce(i)) return t + 1;
|
|
59
57
|
}
|
|
60
58
|
return t;
|
|
61
59
|
}
|
|
62
|
-
function
|
|
63
|
-
let
|
|
64
|
-
return
|
|
60
|
+
function _t(e, t, n = {}) {
|
|
61
|
+
let r = z(e, n.backwards ? t - 1 : t, n);
|
|
62
|
+
return r !== Z(e, r, n);
|
|
63
|
+
}
|
|
64
|
+
function It(e, t) {
|
|
65
|
+
let n = e.node;
|
|
66
|
+
return n.printed = !0, t.printer.printComment(e, t);
|
|
67
|
+
}
|
|
68
|
+
function ue(e, t, n = {}) {
|
|
69
|
+
let { indent: r = !1, marker: i, filter: s = At } = n, a = new Set(e.node?.comments?.filter((x) => !(x.leading || x.trailing || x.marker !== i || !s(x))));
|
|
70
|
+
if (a.size === 0) return "";
|
|
71
|
+
let E = d(l, e.map(({ node: x }) => a.has(x) ? It(e, t) : "", "comments").filter(Boolean));
|
|
72
|
+
return r ? m([l, E]) : E;
|
|
73
|
+
}
|
|
74
|
+
function gt(e) {
|
|
75
|
+
return Array.isArray(e) && e.length > 0;
|
|
76
|
+
}
|
|
77
|
+
function j(e) {
|
|
78
|
+
if (K !== null && typeof K.property) {
|
|
79
|
+
let t = K;
|
|
80
|
+
return K = j.prototype = null, t;
|
|
81
|
+
}
|
|
82
|
+
return K = j.prototype = e ?? Object.create(null), new j();
|
|
83
|
+
}
|
|
84
|
+
function de(e) {
|
|
85
|
+
return j(e);
|
|
65
86
|
}
|
|
66
|
-
function
|
|
87
|
+
function Ot(e, t = "type") {
|
|
88
|
+
de(e);
|
|
89
|
+
function n(r) {
|
|
90
|
+
let i = r[t], s = e[i];
|
|
91
|
+
if (!Array.isArray(s)) throw Object.assign(/* @__PURE__ */ new Error(`Missing visitor keys for '${i}'.`), { node: r });
|
|
92
|
+
return s;
|
|
93
|
+
}
|
|
94
|
+
return n;
|
|
95
|
+
}
|
|
96
|
+
function fe(e, t) {
|
|
97
|
+
e.kind === "StringValue" && e.block && !e.value.includes(`
|
|
98
|
+
`) && (t.value = e.value.trim());
|
|
99
|
+
}
|
|
100
|
+
function kt(e, t) {
|
|
67
101
|
if (t === !1) return !1;
|
|
68
102
|
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
69
103
|
for (let n = t + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
|
|
70
104
|
}
|
|
71
105
|
return t;
|
|
72
106
|
}
|
|
73
|
-
function
|
|
74
|
-
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ?
|
|
107
|
+
function Ct(e, t) {
|
|
108
|
+
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? ke(e, t) : t;
|
|
75
109
|
}
|
|
76
|
-
function
|
|
77
|
-
let n = null,
|
|
78
|
-
for (;
|
|
79
|
-
return
|
|
110
|
+
function Rt(e, t) {
|
|
111
|
+
let n = null, r = t;
|
|
112
|
+
for (; r !== n;) n = r, r = ve(e, r), r = Ke(e, r), r = z(e, r);
|
|
113
|
+
return r = je(e, r), r = Z(e, r), r !== !1 && Re(e, r);
|
|
80
114
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
115
|
+
function I(e, t, n, r) {
|
|
116
|
+
return e.map(({ isLast: i, node: s }) => {
|
|
117
|
+
let a = n();
|
|
118
|
+
return !i && Ye(t.originalText, te(s)) ? [a, l] : a;
|
|
119
|
+
}, r);
|
|
83
120
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
121
|
+
function me(e, t, n) {
|
|
122
|
+
let { node: r } = e;
|
|
123
|
+
return T(r.arguments) ? N([
|
|
124
|
+
"(",
|
|
125
|
+
m([u, d([_("", ", "), u], I(e, t, n, "arguments"))]),
|
|
126
|
+
u,
|
|
127
|
+
")"
|
|
128
|
+
]) : "";
|
|
90
129
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
130
|
+
function A(e, t, n) {
|
|
131
|
+
let { node: r } = e;
|
|
132
|
+
if (!r.description) return "";
|
|
133
|
+
let i = [n("description")];
|
|
134
|
+
return r.kind === "InputValueDefinition" && !r.description.block ? i.push(S) : i.push(l), i;
|
|
93
135
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return s;
|
|
100
|
-
}
|
|
101
|
-
return n;
|
|
136
|
+
function y(e, t) {
|
|
137
|
+
let { node: n } = e;
|
|
138
|
+
if (!T(n.directives)) return "";
|
|
139
|
+
let r = d(S, e.map(t, "directives"));
|
|
140
|
+
return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? N([S, r]) : [" ", N(m([u, r]))];
|
|
102
141
|
}
|
|
103
|
-
function
|
|
104
|
-
let { node:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
142
|
+
function he(e, t) {
|
|
143
|
+
let { node: n } = e;
|
|
144
|
+
return T(n.variableDefinitions) ? N([
|
|
145
|
+
"(",
|
|
146
|
+
m([u, d([_("", ", "), u], e.map(t, "variableDefinitions"))]),
|
|
147
|
+
u,
|
|
148
|
+
")"
|
|
149
|
+
]) : "";
|
|
108
150
|
}
|
|
109
|
-
function
|
|
110
|
-
let { node:
|
|
111
|
-
switch (
|
|
112
|
-
case "Document": return [...
|
|
151
|
+
function Lt(e, t, n) {
|
|
152
|
+
let { node: r } = e;
|
|
153
|
+
switch (r.kind) {
|
|
154
|
+
case "Document": return [...d(l, I(e, t, n, "definitions")), l];
|
|
113
155
|
case "OperationDefinition": {
|
|
114
|
-
let
|
|
156
|
+
let i = t.originalText[ee(r)] !== "{", s = !!r.name;
|
|
115
157
|
return [
|
|
116
158
|
A(e, t, n),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
!
|
|
159
|
+
i ? r.operation : "",
|
|
160
|
+
i && s ? [" ", n("name")] : "",
|
|
161
|
+
i && !s && T(r.variableDefinitions) ? " " : "",
|
|
162
|
+
he(e, n),
|
|
163
|
+
y(e, n),
|
|
164
|
+
!i && !s ? "" : " ",
|
|
123
165
|
n("selectionSet")
|
|
124
166
|
];
|
|
125
167
|
}
|
|
@@ -127,74 +169,80 @@ function Dt(e, t, n) {
|
|
|
127
169
|
A(e, t, n),
|
|
128
170
|
"fragment ",
|
|
129
171
|
n("name"),
|
|
130
|
-
|
|
172
|
+
he(e, n),
|
|
131
173
|
" on ",
|
|
132
174
|
n("typeCondition"),
|
|
133
|
-
|
|
175
|
+
y(e, n),
|
|
134
176
|
" ",
|
|
135
177
|
n("selectionSet")
|
|
136
178
|
];
|
|
137
179
|
case "SelectionSet": return [
|
|
138
180
|
"{",
|
|
139
|
-
|
|
140
|
-
|
|
181
|
+
m([l, d(l, I(e, t, n, "selections"))]),
|
|
182
|
+
l,
|
|
141
183
|
"}"
|
|
142
184
|
];
|
|
143
|
-
case "Field": return
|
|
144
|
-
|
|
185
|
+
case "Field": return N([
|
|
186
|
+
r.alias ? [n("alias"), ": "] : "",
|
|
145
187
|
n("name"),
|
|
146
|
-
|
|
188
|
+
T(r.arguments) ? N([
|
|
147
189
|
"(",
|
|
148
|
-
|
|
149
|
-
|
|
190
|
+
m([u, d([_("", ", "), u], I(e, t, n, "arguments"))]),
|
|
191
|
+
u,
|
|
150
192
|
")"
|
|
151
193
|
]) : "",
|
|
152
|
-
|
|
153
|
-
|
|
194
|
+
y(e, n),
|
|
195
|
+
r.selectionSet ? " " : "",
|
|
154
196
|
n("selectionSet")
|
|
155
197
|
]);
|
|
156
|
-
case "Name": return
|
|
198
|
+
case "Name": return r.value;
|
|
157
199
|
case "StringValue":
|
|
158
|
-
if (
|
|
159
|
-
let
|
|
200
|
+
if (r.block) {
|
|
201
|
+
let i = X(0, r.value, "\"\"\"", "\\\"\"\"").split(`
|
|
160
202
|
`);
|
|
161
|
-
return
|
|
203
|
+
return i.length === 1 && (i[0] = i[0].trim()), i.every((s) => s === "") && (i.length = 0), d(l, [
|
|
162
204
|
"\"\"\"",
|
|
163
|
-
...
|
|
205
|
+
...i,
|
|
164
206
|
"\"\"\""
|
|
165
207
|
]);
|
|
166
208
|
}
|
|
167
209
|
return [
|
|
168
210
|
"\"",
|
|
169
|
-
|
|
211
|
+
X(0, X(0, r.value, /["\\]/g, "\\$&"), `
|
|
170
212
|
`, "\\n"),
|
|
171
213
|
"\""
|
|
172
214
|
];
|
|
173
215
|
case "IntValue":
|
|
174
216
|
case "FloatValue":
|
|
175
|
-
case "EnumValue": return
|
|
176
|
-
case "BooleanValue": return
|
|
217
|
+
case "EnumValue": return r.value;
|
|
218
|
+
case "BooleanValue": return r.value ? "true" : "false";
|
|
177
219
|
case "NullValue": return "null";
|
|
178
220
|
case "Variable": return ["$", n("name")];
|
|
179
|
-
case "ListValue":
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
221
|
+
case "ListValue": {
|
|
222
|
+
let i = !T(r.values);
|
|
223
|
+
return N([
|
|
224
|
+
"[",
|
|
225
|
+
ue(e, t, { indent: !0 }),
|
|
226
|
+
i ? "" : m([u, d([_("", ", "), u], e.map(n, "values"))]),
|
|
227
|
+
u,
|
|
228
|
+
"]"
|
|
229
|
+
]);
|
|
230
|
+
}
|
|
185
231
|
case "ObjectValue": {
|
|
186
|
-
let r = t.bracketSpacing && i
|
|
187
|
-
return
|
|
232
|
+
let i = !T(r.fields), s = t.bracketSpacing && !i ? " " : "";
|
|
233
|
+
return N([
|
|
188
234
|
"{",
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
235
|
+
s,
|
|
236
|
+
ue(e, t, { indent: !0 }),
|
|
237
|
+
i ? "" : [m([u, d([_("", ", "), u], e.map(n, "fields"))])],
|
|
238
|
+
u,
|
|
239
|
+
_("", s),
|
|
193
240
|
"}"
|
|
194
241
|
]);
|
|
195
242
|
}
|
|
196
243
|
case "ObjectField":
|
|
197
|
-
case "Argument":
|
|
244
|
+
case "Argument":
|
|
245
|
+
case "FragmentArgument": return [
|
|
198
246
|
n("name"),
|
|
199
247
|
": ",
|
|
200
248
|
n("value")
|
|
@@ -202,12 +250,7 @@ function Dt(e, t, n) {
|
|
|
202
250
|
case "Directive": return [
|
|
203
251
|
"@",
|
|
204
252
|
n("name"),
|
|
205
|
-
|
|
206
|
-
"(",
|
|
207
|
-
x([l, E([I("", ", "), l], g(e, t, n, "arguments"))]),
|
|
208
|
-
l,
|
|
209
|
-
")"
|
|
210
|
-
]) : ""
|
|
253
|
+
me(e, t, n)
|
|
211
254
|
];
|
|
212
255
|
case "NamedType": return n("name");
|
|
213
256
|
case "VariableDefinition": return [
|
|
@@ -215,8 +258,8 @@ function Dt(e, t, n) {
|
|
|
215
258
|
n("variable"),
|
|
216
259
|
": ",
|
|
217
260
|
n("type"),
|
|
218
|
-
|
|
219
|
-
|
|
261
|
+
r.defaultValue ? [" = ", n("defaultValue")] : "",
|
|
262
|
+
y(e, n)
|
|
220
263
|
];
|
|
221
264
|
case "ObjectTypeExtension":
|
|
222
265
|
case "ObjectTypeDefinition":
|
|
@@ -224,124 +267,131 @@ function Dt(e, t, n) {
|
|
|
224
267
|
case "InputObjectTypeDefinition":
|
|
225
268
|
case "InterfaceTypeExtension":
|
|
226
269
|
case "InterfaceTypeDefinition": {
|
|
227
|
-
let { kind:
|
|
228
|
-
return
|
|
270
|
+
let { kind: i } = r, s = [];
|
|
271
|
+
return i.endsWith("TypeDefinition") ? s.push(A(e, t, n)) : s.push("extend "), i.startsWith("ObjectType") ? s.push("type") : i.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !i.startsWith("InputObjectType") && T(r.interfaces) && s.push(" implements ", m([N([d([" &", S], e.map(n, "interfaces"))])])), s.push(y(e, n)), T(r.fields) && s.push([
|
|
229
272
|
" {",
|
|
230
|
-
|
|
231
|
-
|
|
273
|
+
m([l, d(l, I(e, t, n, "fields"))]),
|
|
274
|
+
l,
|
|
232
275
|
"}"
|
|
233
276
|
]), s;
|
|
234
277
|
}
|
|
235
278
|
case "FieldDefinition": return [
|
|
236
279
|
A(e, t, n),
|
|
237
280
|
n("name"),
|
|
238
|
-
|
|
281
|
+
T(r.arguments) ? N([
|
|
239
282
|
"(",
|
|
240
|
-
|
|
241
|
-
|
|
283
|
+
m([u, d([_("", ", "), u], I(e, t, n, "arguments"))]),
|
|
284
|
+
u,
|
|
242
285
|
")"
|
|
243
286
|
]) : "",
|
|
244
287
|
": ",
|
|
245
288
|
n("type"),
|
|
246
|
-
|
|
289
|
+
y(e, n)
|
|
247
290
|
];
|
|
248
291
|
case "DirectiveDefinition": return [
|
|
249
292
|
A(e, t, n),
|
|
250
293
|
"directive ",
|
|
251
294
|
"@",
|
|
252
295
|
n("name"),
|
|
253
|
-
|
|
296
|
+
T(r.arguments) ? N([
|
|
254
297
|
"(",
|
|
255
|
-
|
|
256
|
-
|
|
298
|
+
m([u, d([_("", ", "), u], I(e, t, n, "arguments"))]),
|
|
299
|
+
u,
|
|
257
300
|
")"
|
|
258
301
|
]) : "",
|
|
259
|
-
|
|
302
|
+
y(e, n),
|
|
303
|
+
r.repeatable ? " repeatable" : "",
|
|
260
304
|
" on ",
|
|
261
|
-
...
|
|
305
|
+
...d(" | ", e.map(n, "locations"))
|
|
306
|
+
];
|
|
307
|
+
case "DirectiveExtension": return [
|
|
308
|
+
"extend directive @",
|
|
309
|
+
n("name"),
|
|
310
|
+
y(e, n)
|
|
262
311
|
];
|
|
263
312
|
case "EnumTypeExtension":
|
|
264
313
|
case "EnumTypeDefinition": return [
|
|
265
314
|
A(e, t, n),
|
|
266
|
-
|
|
315
|
+
r.kind === "EnumTypeExtension" ? "extend " : "",
|
|
267
316
|
"enum ",
|
|
268
317
|
n("name"),
|
|
269
|
-
|
|
270
|
-
|
|
318
|
+
y(e, n),
|
|
319
|
+
T(r.values) ? [
|
|
271
320
|
" {",
|
|
272
|
-
|
|
273
|
-
|
|
321
|
+
m([l, d(l, I(e, t, n, "values"))]),
|
|
322
|
+
l,
|
|
274
323
|
"}"
|
|
275
324
|
] : ""
|
|
276
325
|
];
|
|
277
326
|
case "EnumValueDefinition": return [
|
|
278
327
|
A(e, t, n),
|
|
279
328
|
n("name"),
|
|
280
|
-
|
|
329
|
+
y(e, n)
|
|
281
330
|
];
|
|
282
331
|
case "InputValueDefinition": return [
|
|
283
332
|
A(e, t, n),
|
|
284
333
|
n("name"),
|
|
285
334
|
": ",
|
|
286
335
|
n("type"),
|
|
287
|
-
|
|
288
|
-
|
|
336
|
+
r.defaultValue ? [" = ", n("defaultValue")] : "",
|
|
337
|
+
y(e, n)
|
|
289
338
|
];
|
|
290
339
|
case "SchemaExtension": return [
|
|
291
340
|
"extend schema",
|
|
292
|
-
|
|
293
|
-
...
|
|
341
|
+
y(e, n),
|
|
342
|
+
...T(r.operationTypes) ? [
|
|
294
343
|
" {",
|
|
295
|
-
|
|
296
|
-
|
|
344
|
+
m([l, d(l, I(e, t, n, "operationTypes"))]),
|
|
345
|
+
l,
|
|
297
346
|
"}"
|
|
298
347
|
] : []
|
|
299
348
|
];
|
|
300
349
|
case "SchemaDefinition": return [
|
|
301
350
|
A(e, t, n),
|
|
302
351
|
"schema",
|
|
303
|
-
|
|
352
|
+
y(e, n),
|
|
304
353
|
" {",
|
|
305
|
-
|
|
306
|
-
|
|
354
|
+
T(r.operationTypes) ? m([l, d(l, I(e, t, n, "operationTypes"))]) : "",
|
|
355
|
+
l,
|
|
307
356
|
"}"
|
|
308
357
|
];
|
|
309
358
|
case "OperationTypeDefinition": return [
|
|
310
|
-
|
|
359
|
+
r.operation,
|
|
311
360
|
": ",
|
|
312
361
|
n("type")
|
|
313
362
|
];
|
|
314
363
|
case "FragmentSpread": return [
|
|
315
364
|
"...",
|
|
316
365
|
n("name"),
|
|
317
|
-
|
|
366
|
+
me(e, t, n),
|
|
367
|
+
y(e, n)
|
|
318
368
|
];
|
|
319
369
|
case "InlineFragment": return [
|
|
320
370
|
"...",
|
|
321
|
-
|
|
322
|
-
|
|
371
|
+
r.typeCondition ? [" on ", n("typeCondition")] : "",
|
|
372
|
+
y(e, n),
|
|
323
373
|
" ",
|
|
324
374
|
n("selectionSet")
|
|
325
375
|
];
|
|
326
376
|
case "UnionTypeExtension":
|
|
327
|
-
case "UnionTypeDefinition": return
|
|
328
|
-
|
|
377
|
+
case "UnionTypeDefinition": return N([A(e, t, n), N([
|
|
378
|
+
r.kind === "UnionTypeExtension" ? "extend " : "",
|
|
329
379
|
"union ",
|
|
330
380
|
n("name"),
|
|
331
|
-
|
|
332
|
-
|
|
381
|
+
y(e, n),
|
|
382
|
+
T(r.types) ? [
|
|
333
383
|
" =",
|
|
334
|
-
|
|
335
|
-
|
|
384
|
+
_("", " "),
|
|
385
|
+
m([_([S, "| "]), d([S, "| "], e.map(n, "types"))])
|
|
336
386
|
] : ""
|
|
337
387
|
])]);
|
|
338
388
|
case "ScalarTypeExtension":
|
|
339
389
|
case "ScalarTypeDefinition": return [
|
|
340
390
|
A(e, t, n),
|
|
341
|
-
|
|
391
|
+
r.kind === "ScalarTypeExtension" ? "extend " : "",
|
|
342
392
|
"scalar ",
|
|
343
393
|
n("name"),
|
|
344
|
-
|
|
394
|
+
y(e, n)
|
|
345
395
|
];
|
|
346
396
|
case "NonNullType": return [n("type"), "!"];
|
|
347
397
|
case "ListType": return [
|
|
@@ -349,302 +399,280 @@ function Dt(e, t, n) {
|
|
|
349
399
|
n("type"),
|
|
350
400
|
"]"
|
|
351
401
|
];
|
|
352
|
-
default: throw new
|
|
402
|
+
default: throw new Le(r, "Graphql", "kind");
|
|
353
403
|
}
|
|
354
404
|
}
|
|
355
|
-
function
|
|
356
|
-
if (n.directives.length === 0) return "";
|
|
357
|
-
let i = E(k, e.map(t, "directives"));
|
|
358
|
-
return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(x([l, i]))];
|
|
359
|
-
}
|
|
360
|
-
function g(e, t, n, i) {
|
|
361
|
-
return e.map(({ isLast: r, node: s }) => {
|
|
362
|
-
let a = n();
|
|
363
|
-
return !r && Se(t.originalText, q(s)) ? [a, f] : a;
|
|
364
|
-
}, i);
|
|
365
|
-
}
|
|
366
|
-
function gt(e) {
|
|
405
|
+
function bt(e) {
|
|
367
406
|
return e.kind !== "Comment";
|
|
368
407
|
}
|
|
369
|
-
function
|
|
408
|
+
function Ft({ node: e }) {
|
|
370
409
|
if (e.kind === "Comment") return "#" + e.value.trimEnd();
|
|
371
410
|
throw new Error("Not a comment: " + JSON.stringify(e));
|
|
372
411
|
}
|
|
373
|
-
function
|
|
374
|
-
let { node: i } = e, r = [], { interfaces: s } = i, a = e.map(n, "interfaces");
|
|
375
|
-
for (let u = 0; u < s.length; u++) {
|
|
376
|
-
let p = s[u];
|
|
377
|
-
r.push(a[u]);
|
|
378
|
-
let T = s[u + 1];
|
|
379
|
-
if (T) {
|
|
380
|
-
let D = t.originalText.slice(p.loc.end, T.loc.start).includes("#");
|
|
381
|
-
r.push(" &", D ? k : " ");
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
return r;
|
|
385
|
-
}
|
|
386
|
-
function Be(e, t) {
|
|
387
|
-
let { node: n } = e;
|
|
388
|
-
return se(n.variableDefinitions) ? y([
|
|
389
|
-
"(",
|
|
390
|
-
x([l, E([I("", ", "), l], e.map(t, "variableDefinitions"))]),
|
|
391
|
-
l,
|
|
392
|
-
")"
|
|
393
|
-
]) : "";
|
|
394
|
-
}
|
|
395
|
-
function Ue(e, t) {
|
|
396
|
-
e.kind === "StringValue" && e.block && !e.value.includes(`
|
|
397
|
-
`) && (t.value = e.value.trim());
|
|
398
|
-
}
|
|
399
|
-
function Ct(e) {
|
|
412
|
+
function Pt(e) {
|
|
400
413
|
let { node: t } = e;
|
|
401
414
|
return t?.comments?.some((n) => n.value.trim() === "prettier-ignore");
|
|
402
415
|
}
|
|
403
|
-
function
|
|
416
|
+
function Mt(e, t) {
|
|
417
|
+
return e?.__kind === t;
|
|
418
|
+
}
|
|
419
|
+
function Je(e) {
|
|
404
420
|
return typeof e == "object" && e !== null;
|
|
405
421
|
}
|
|
406
|
-
function
|
|
407
|
-
if (
|
|
422
|
+
function We(e, t) {
|
|
423
|
+
if (!e) throw new Error(t ?? "Unexpected invariant triggered.");
|
|
408
424
|
}
|
|
409
|
-
function
|
|
410
|
-
let n = 0,
|
|
411
|
-
for (let
|
|
412
|
-
if (typeof
|
|
413
|
-
n =
|
|
425
|
+
function w(e, t) {
|
|
426
|
+
let n = 0, r = 1;
|
|
427
|
+
for (let i of e.body.matchAll(Ut)) {
|
|
428
|
+
if (typeof i.index != "number" && We(!1), i.index >= t) break;
|
|
429
|
+
n = i.index + i[0].length, r += 1;
|
|
414
430
|
}
|
|
415
431
|
return {
|
|
416
|
-
line:
|
|
432
|
+
line: r,
|
|
417
433
|
column: t + 1 - n
|
|
418
434
|
};
|
|
419
435
|
}
|
|
420
|
-
function
|
|
421
|
-
return
|
|
422
|
-
}
|
|
423
|
-
function
|
|
424
|
-
let n = e.locationOffset.column - 1,
|
|
425
|
-
`,
|
|
426
|
-
if (
|
|
427
|
-
let
|
|
428
|
-
for (let
|
|
429
|
-
return
|
|
430
|
-
[`${a} |`,
|
|
431
|
-
...
|
|
432
|
-
["|", "^".padStart(
|
|
433
|
-
["|",
|
|
436
|
+
function Ee(e) {
|
|
437
|
+
return ne(e.source, w(e.source, e.start));
|
|
438
|
+
}
|
|
439
|
+
function ne(e, t) {
|
|
440
|
+
let n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, p = t.line === 1 ? n : 0, E = t.column + p, x = `${e.name}:${a}:${E}
|
|
441
|
+
`, v = r.split(/\r\n|[\n\r]/g), P = v[i];
|
|
442
|
+
if (P.length > 120) {
|
|
443
|
+
let $ = Math.floor(E / 80), G = E % 80, k = [];
|
|
444
|
+
for (let C = 0; C < P.length; C += 80) k.push(P.slice(C, C + 80));
|
|
445
|
+
return x + ze([
|
|
446
|
+
[`${a} |`, k[0]],
|
|
447
|
+
...k.slice(1, $ + 1).map((C) => ["|", C]),
|
|
448
|
+
["|", "^".padStart(G)],
|
|
449
|
+
["|", k[$ + 1]]
|
|
434
450
|
]);
|
|
435
451
|
}
|
|
436
|
-
return
|
|
437
|
-
[`${a - 1} |`,
|
|
438
|
-
[`${a} |`,
|
|
439
|
-
["|", "^".padStart(
|
|
440
|
-
[`${a + 1} |`,
|
|
452
|
+
return x + ze([
|
|
453
|
+
[`${a - 1} |`, v[i - 1]],
|
|
454
|
+
[`${a} |`, P],
|
|
455
|
+
["|", "^".padStart(E)],
|
|
456
|
+
[`${a + 1} |`, v[i + 1]]
|
|
441
457
|
]);
|
|
442
458
|
}
|
|
443
|
-
function
|
|
444
|
-
let t = e.filter(([
|
|
445
|
-
return t.map(([
|
|
459
|
+
function ze(e) {
|
|
460
|
+
let t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
|
|
461
|
+
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
|
|
446
462
|
`);
|
|
447
463
|
}
|
|
448
|
-
function
|
|
449
|
-
let t = e[0];
|
|
450
|
-
return t == null || "kind" in t || "length" in t ? {
|
|
451
|
-
nodes: t,
|
|
452
|
-
source: e[1],
|
|
453
|
-
positions: e[2],
|
|
454
|
-
path: e[3],
|
|
455
|
-
originalError: e[4],
|
|
456
|
-
extensions: e[5]
|
|
457
|
-
} : t;
|
|
458
|
-
}
|
|
459
|
-
function Qe(e) {
|
|
464
|
+
function Ze(e) {
|
|
460
465
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
461
466
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
464
|
-
source: e,
|
|
465
|
-
positions: [t]
|
|
466
|
-
});
|
|
467
|
+
function Te(e, t) {
|
|
468
|
+
if (!e) throw new Error(t);
|
|
467
469
|
}
|
|
468
|
-
function
|
|
470
|
+
function tt(e) {
|
|
469
471
|
return e === 9 || e === 32;
|
|
470
472
|
}
|
|
471
|
-
function
|
|
473
|
+
function L(e) {
|
|
472
474
|
return e >= 48 && e <= 57;
|
|
473
475
|
}
|
|
474
|
-
function
|
|
476
|
+
function nt(e) {
|
|
475
477
|
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
476
478
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
479
|
+
function xe(e) {
|
|
480
|
+
return nt(e) || e === 95;
|
|
479
481
|
}
|
|
480
|
-
function
|
|
481
|
-
return
|
|
482
|
+
function it(e) {
|
|
483
|
+
return nt(e) || L(e) || e === 95;
|
|
482
484
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
485
|
-
let
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
let u = e[a], p = Pt(u);
|
|
489
|
-
p !== u.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && p < n && (n = p));
|
|
485
|
+
function rt(e) {
|
|
486
|
+
let t = Number.MAX_SAFE_INTEGER, n = null, r = -1;
|
|
487
|
+
for (let i = 0; i < e.length; ++i) {
|
|
488
|
+
let s = e[i], a = Mn(s);
|
|
489
|
+
a !== s.length && (n ?? (n = i), r = i, i !== 0 && a < t && (t = a));
|
|
490
490
|
}
|
|
491
|
-
return e.map((
|
|
491
|
+
return e.map((i, s) => s === 0 ? i : i.slice(t)).slice(n ?? 0, r + 1);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Mn(e) {
|
|
494
494
|
let t = 0;
|
|
495
|
-
for (; t < e.length &&
|
|
495
|
+
for (; t < e.length && tt(e.charCodeAt(t));) ++t;
|
|
496
496
|
return t;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function f(e, t, n) {
|
|
499
|
+
return new R(`Syntax Error: ${n}`, {
|
|
500
|
+
source: e,
|
|
501
|
+
positions: [t]
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
function Un() {
|
|
505
|
+
let e;
|
|
506
|
+
try {
|
|
507
|
+
let t = globalThis.process;
|
|
508
|
+
typeof t?.getBuiltinModule == "function" && (e = t.getBuiltinModule("node:diagnostics_channel"));
|
|
509
|
+
} catch {}
|
|
510
|
+
return e;
|
|
511
|
+
}
|
|
512
|
+
function st(e) {
|
|
513
|
+
if (e == null) return !1;
|
|
514
|
+
let t = e.hasSubscribers;
|
|
515
|
+
if (t !== void 0) return t;
|
|
516
|
+
for (let n of Bn) if (e[n].hasSubscribers) return !0;
|
|
517
|
+
return !1;
|
|
518
|
+
}
|
|
519
|
+
function at(e) {
|
|
499
520
|
return e === o.BANG || e === o.DOLLAR || e === o.AMP || e === o.PAREN_L || e === o.PAREN_R || e === o.DOT || e === o.SPREAD || e === o.COLON || e === o.EQUALS || e === o.AT || e === o.BRACKET_L || e === o.BRACKET_R || e === o.BRACE_L || e === o.PIPE || e === o.BRACE_R;
|
|
500
521
|
}
|
|
501
|
-
function
|
|
522
|
+
function U(e) {
|
|
502
523
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
503
524
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
525
|
+
function re(e, t) {
|
|
526
|
+
return ct(e.charCodeAt(t)) && pt(e.charCodeAt(t + 1));
|
|
506
527
|
}
|
|
507
|
-
function
|
|
528
|
+
function ct(e) {
|
|
508
529
|
return e >= 55296 && e <= 56319;
|
|
509
530
|
}
|
|
510
|
-
function
|
|
531
|
+
function pt(e) {
|
|
511
532
|
return e >= 56320 && e <= 57343;
|
|
512
533
|
}
|
|
513
|
-
function
|
|
534
|
+
function F(e, t) {
|
|
514
535
|
let n = e.source.body.codePointAt(t);
|
|
515
536
|
if (n === void 0) return o.EOF;
|
|
516
537
|
if (n >= 32 && n <= 126) {
|
|
517
|
-
let
|
|
518
|
-
return
|
|
538
|
+
let r = String.fromCodePoint(n);
|
|
539
|
+
return r === "\"" ? `'"'` : `"${r}"`;
|
|
519
540
|
}
|
|
520
541
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
521
542
|
}
|
|
522
|
-
function
|
|
543
|
+
function h(e, t, n, r, i) {
|
|
523
544
|
let s = e.line;
|
|
524
|
-
return new
|
|
545
|
+
return new V(t, n, r, s, 1 + n - e.lineStart, i);
|
|
525
546
|
}
|
|
526
|
-
function
|
|
527
|
-
let n = e.source.body,
|
|
528
|
-
for (;
|
|
529
|
-
let s = n.charCodeAt(
|
|
547
|
+
function Gn(e, t) {
|
|
548
|
+
let n = e.source.body, r = n.length, i = t;
|
|
549
|
+
for (; i < r;) {
|
|
550
|
+
let s = n.charCodeAt(i);
|
|
530
551
|
switch (s) {
|
|
531
552
|
case 65279:
|
|
532
553
|
case 9:
|
|
533
554
|
case 32:
|
|
534
555
|
case 44:
|
|
535
|
-
++
|
|
556
|
+
++i;
|
|
536
557
|
continue;
|
|
537
558
|
case 10:
|
|
538
|
-
++
|
|
559
|
+
++i, ++e.line, e.lineStart = i;
|
|
539
560
|
continue;
|
|
540
561
|
case 13:
|
|
541
|
-
n.charCodeAt(
|
|
562
|
+
n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
|
|
542
563
|
continue;
|
|
543
|
-
case 35: return
|
|
544
|
-
case 33: return
|
|
545
|
-
case 36: return
|
|
546
|
-
case 38: return
|
|
547
|
-
case 40: return
|
|
548
|
-
case 41: return
|
|
549
|
-
case 46:
|
|
550
|
-
|
|
564
|
+
case 35: return Kn(e, i);
|
|
565
|
+
case 33: return h(e, o.BANG, i, i + 1);
|
|
566
|
+
case 36: return h(e, o.DOLLAR, i, i + 1);
|
|
567
|
+
case 38: return h(e, o.AMP, i, i + 1);
|
|
568
|
+
case 40: return h(e, o.PAREN_L, i, i + 1);
|
|
569
|
+
case 41: return h(e, o.PAREN_R, i, i + 1);
|
|
570
|
+
case 46: {
|
|
571
|
+
let a = n.charCodeAt(i + 1);
|
|
572
|
+
if (a === 46 && n.charCodeAt(i + 2) === 46) return h(e, o.SPREAD, i, i + 3);
|
|
573
|
+
if (a === 46) throw f(e.source, i, "Unexpected \"..\", did you mean \"...\"?");
|
|
574
|
+
if (L(a)) {
|
|
575
|
+
let p = e.source.body.slice(i + 1, ie(e, i + 1, a));
|
|
576
|
+
throw f(e.source, i, `Invalid number, expected digit before ".", did you mean "0.${p}"?`);
|
|
577
|
+
}
|
|
551
578
|
break;
|
|
552
|
-
|
|
553
|
-
case
|
|
554
|
-
case
|
|
555
|
-
case
|
|
556
|
-
case
|
|
557
|
-
case
|
|
558
|
-
case
|
|
559
|
-
case
|
|
560
|
-
case
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (
|
|
564
|
-
|
|
579
|
+
}
|
|
580
|
+
case 58: return h(e, o.COLON, i, i + 1);
|
|
581
|
+
case 61: return h(e, o.EQUALS, i, i + 1);
|
|
582
|
+
case 64: return h(e, o.AT, i, i + 1);
|
|
583
|
+
case 91: return h(e, o.BRACKET_L, i, i + 1);
|
|
584
|
+
case 93: return h(e, o.BRACKET_R, i, i + 1);
|
|
585
|
+
case 123: return h(e, o.BRACE_L, i, i + 1);
|
|
586
|
+
case 124: return h(e, o.PIPE, i, i + 1);
|
|
587
|
+
case 125: return h(e, o.BRACE_R, i, i + 1);
|
|
588
|
+
case 34: return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Xn(e, i) : Yn(e, i);
|
|
589
|
+
}
|
|
590
|
+
if (L(s) || s === 45) return jn(e, i, s);
|
|
591
|
+
if (xe(s)) return Hn(e, i);
|
|
592
|
+
throw f(e.source, i, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : U(s) || re(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`);
|
|
565
593
|
}
|
|
566
|
-
return
|
|
594
|
+
return h(e, o.EOF, r, r);
|
|
567
595
|
}
|
|
568
|
-
function
|
|
569
|
-
let n = e.source.body,
|
|
570
|
-
for (;
|
|
571
|
-
let s = n.charCodeAt(
|
|
596
|
+
function Kn(e, t) {
|
|
597
|
+
let n = e.source.body, r = n.length, i = t + 1;
|
|
598
|
+
for (; i < r;) {
|
|
599
|
+
let s = n.charCodeAt(i);
|
|
572
600
|
if (s === 10 || s === 13) break;
|
|
573
|
-
if (
|
|
574
|
-
else if (
|
|
601
|
+
if (U(s)) ++i;
|
|
602
|
+
else if (re(n, i)) i += 2;
|
|
575
603
|
else break;
|
|
576
604
|
}
|
|
577
|
-
return
|
|
578
|
-
}
|
|
579
|
-
function
|
|
580
|
-
let
|
|
581
|
-
if (s === 45 && (s =
|
|
582
|
-
if (s =
|
|
583
|
-
} else
|
|
584
|
-
if (s === 46 && (a = !0, s =
|
|
585
|
-
return
|
|
586
|
-
}
|
|
587
|
-
function
|
|
588
|
-
if (!
|
|
589
|
-
let
|
|
590
|
-
for (;
|
|
591
|
-
return
|
|
592
|
-
}
|
|
593
|
-
function
|
|
594
|
-
let n = e.source.body,
|
|
595
|
-
for (;
|
|
596
|
-
let
|
|
597
|
-
if (
|
|
598
|
-
if (
|
|
599
|
-
a += n.slice(s,
|
|
600
|
-
let
|
|
601
|
-
a +=
|
|
605
|
+
return h(e, o.COMMENT, t, i, n.slice(t + 1, i));
|
|
606
|
+
}
|
|
607
|
+
function jn(e, t, n) {
|
|
608
|
+
let r = e.source.body, i = t, s = n, a = !1;
|
|
609
|
+
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
610
|
+
if (s = r.charCodeAt(++i), L(s)) throw f(e.source, i, `Invalid number, unexpected digit after 0: ${F(e, i)}.`);
|
|
611
|
+
} else i = ie(e, i, s), s = r.charCodeAt(i);
|
|
612
|
+
if (s === 46 && (a = !0, s = r.charCodeAt(++i), i = ie(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (a = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ie(e, i, s), s = r.charCodeAt(i)), s === 46 || xe(s)) throw f(e.source, i, `Invalid number, expected digit but got: ${F(e, i)}.`);
|
|
613
|
+
return h(e, a ? o.FLOAT : o.INT, t, i, r.slice(t, i));
|
|
614
|
+
}
|
|
615
|
+
function ie(e, t, n) {
|
|
616
|
+
if (!L(n)) throw f(e.source, t, `Invalid number, expected digit but got: ${F(e, t)}.`);
|
|
617
|
+
let r = e.source.body, i = t + 1;
|
|
618
|
+
for (; L(r.charCodeAt(i));) ++i;
|
|
619
|
+
return i;
|
|
620
|
+
}
|
|
621
|
+
function Yn(e, t) {
|
|
622
|
+
let n = e.source.body, r = n.length, i = t + 1, s = i, a = "";
|
|
623
|
+
for (; i < r;) {
|
|
624
|
+
let p = n.charCodeAt(i);
|
|
625
|
+
if (p === 34) return a += n.slice(s, i), h(e, o.STRING, t, i + 1, a);
|
|
626
|
+
if (p === 92) {
|
|
627
|
+
a += n.slice(s, i);
|
|
628
|
+
let E = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? qn(e, i) : Qn(e, i) : $n(e, i);
|
|
629
|
+
a += E.value, i += E.size, s = i;
|
|
602
630
|
continue;
|
|
603
631
|
}
|
|
604
|
-
if (
|
|
605
|
-
if (
|
|
606
|
-
else if (
|
|
607
|
-
else throw
|
|
632
|
+
if (p === 10 || p === 13) break;
|
|
633
|
+
if (U(p)) ++i;
|
|
634
|
+
else if (re(n, i)) i += 2;
|
|
635
|
+
else throw f(e.source, i, `Invalid character within String: ${F(e, i)}.`);
|
|
608
636
|
}
|
|
609
|
-
throw
|
|
637
|
+
throw f(e.source, i, "Unterminated string.");
|
|
610
638
|
}
|
|
611
|
-
function
|
|
612
|
-
let n = e.source.body,
|
|
613
|
-
for (;
|
|
614
|
-
let s = n.charCodeAt(t +
|
|
639
|
+
function qn(e, t) {
|
|
640
|
+
let n = e.source.body, r = 0, i = 3;
|
|
641
|
+
for (; i < 12;) {
|
|
642
|
+
let s = n.charCodeAt(t + i++);
|
|
615
643
|
if (s === 125) {
|
|
616
|
-
if (
|
|
644
|
+
if (i < 5 || !U(r)) break;
|
|
617
645
|
return {
|
|
618
|
-
value: String.fromCodePoint(
|
|
619
|
-
size:
|
|
646
|
+
value: String.fromCodePoint(r),
|
|
647
|
+
size: i
|
|
620
648
|
};
|
|
621
649
|
}
|
|
622
|
-
if (
|
|
650
|
+
if (r = r << 4 | q(s), r < 0) break;
|
|
623
651
|
}
|
|
624
|
-
throw
|
|
652
|
+
throw f(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + i)}".`);
|
|
625
653
|
}
|
|
626
|
-
function
|
|
627
|
-
let n = e.source.body,
|
|
628
|
-
if (
|
|
629
|
-
value: String.fromCodePoint(
|
|
654
|
+
function Qn(e, t) {
|
|
655
|
+
let n = e.source.body, r = ot(n, t + 2);
|
|
656
|
+
if (U(r)) return {
|
|
657
|
+
value: String.fromCodePoint(r),
|
|
630
658
|
size: 6
|
|
631
659
|
};
|
|
632
|
-
if (
|
|
633
|
-
let
|
|
634
|
-
if (
|
|
635
|
-
value: String.fromCodePoint(
|
|
660
|
+
if (ct(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
661
|
+
let i = ot(n, t + 8);
|
|
662
|
+
if (pt(i)) return {
|
|
663
|
+
value: String.fromCodePoint(r, i),
|
|
636
664
|
size: 12
|
|
637
665
|
};
|
|
638
666
|
}
|
|
639
|
-
throw
|
|
667
|
+
throw f(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
|
|
640
668
|
}
|
|
641
|
-
function
|
|
642
|
-
return
|
|
669
|
+
function ot(e, t) {
|
|
670
|
+
return q(e.charCodeAt(t)) << 12 | q(e.charCodeAt(t + 1)) << 8 | q(e.charCodeAt(t + 2)) << 4 | q(e.charCodeAt(t + 3));
|
|
643
671
|
}
|
|
644
|
-
function
|
|
672
|
+
function q(e) {
|
|
645
673
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
646
674
|
}
|
|
647
|
-
function
|
|
675
|
+
function $n(e, t) {
|
|
648
676
|
let n = e.source.body;
|
|
649
677
|
switch (n.charCodeAt(t + 1)) {
|
|
650
678
|
case 34: return {
|
|
@@ -681,220 +709,170 @@ function Gt(e, t) {
|
|
|
681
709
|
size: 2
|
|
682
710
|
};
|
|
683
711
|
}
|
|
684
|
-
throw
|
|
685
|
-
}
|
|
686
|
-
function
|
|
687
|
-
let n = e.source.body,
|
|
688
|
-
for (; s <
|
|
689
|
-
let
|
|
690
|
-
if (
|
|
691
|
-
|
|
692
|
-
let
|
|
712
|
+
throw f(e.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
|
|
713
|
+
}
|
|
714
|
+
function Xn(e, t) {
|
|
715
|
+
let n = e.source.body, r = n.length, i = e.lineStart, s = t + 3, a = s, p = "", E = [];
|
|
716
|
+
for (; s < r;) {
|
|
717
|
+
let x = n.charCodeAt(s);
|
|
718
|
+
if (x === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
719
|
+
p += n.slice(a, s), E.push(p);
|
|
720
|
+
let v = h(e, o.BLOCK_STRING, t, s + 3, rt(E).join(`
|
|
693
721
|
`));
|
|
694
|
-
return e.line +=
|
|
722
|
+
return e.line += E.length - 1, e.lineStart = i, v;
|
|
695
723
|
}
|
|
696
|
-
if (
|
|
697
|
-
|
|
724
|
+
if (x === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
725
|
+
p += n.slice(a, s), a = s + 1, s += 4;
|
|
698
726
|
continue;
|
|
699
727
|
}
|
|
700
|
-
if (
|
|
701
|
-
|
|
728
|
+
if (x === 10 || x === 13) {
|
|
729
|
+
p += n.slice(a, s), E.push(p), x === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, p = "", a = s, i = s;
|
|
702
730
|
continue;
|
|
703
731
|
}
|
|
704
|
-
if (
|
|
705
|
-
else if (
|
|
706
|
-
else throw
|
|
732
|
+
if (U(x)) ++s;
|
|
733
|
+
else if (re(n, s)) s += 2;
|
|
734
|
+
else throw f(e.source, s, `Invalid character within String: ${F(e, s)}.`);
|
|
707
735
|
}
|
|
708
|
-
throw
|
|
736
|
+
throw f(e.source, s, "Unterminated string.");
|
|
709
737
|
}
|
|
710
|
-
function
|
|
711
|
-
let n = e.source.body,
|
|
712
|
-
for (;
|
|
738
|
+
function Hn(e, t) {
|
|
739
|
+
let n = e.source.body, r = n.length, i = t + 1;
|
|
740
|
+
for (; i < r;) if (it(n.charCodeAt(i))) ++i;
|
|
713
741
|
else break;
|
|
714
|
-
return
|
|
742
|
+
return h(e, o.NAME, t, i, n.slice(t, i));
|
|
715
743
|
}
|
|
716
|
-
function
|
|
717
|
-
|
|
744
|
+
function lt(e) {
|
|
745
|
+
return He(e, ut, B);
|
|
718
746
|
}
|
|
719
|
-
function
|
|
720
|
-
return
|
|
747
|
+
function oe(e, t) {
|
|
748
|
+
return st(Ne) ? Ne.traceSync(() => dt(e, t), { source: e }) : dt(e, t);
|
|
721
749
|
}
|
|
722
|
-
function
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
case "function": return e.name ? `[function ${e.name}]` : "[function]";
|
|
726
|
-
case "object": return $t(e, t);
|
|
727
|
-
default: return String(e);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
function $t(e, t) {
|
|
731
|
-
if (e === null) return "null";
|
|
732
|
-
if (t.includes(e)) return "[Circular]";
|
|
733
|
-
let n = [...t, e];
|
|
734
|
-
if (Xt(e)) {
|
|
735
|
-
let i = e.toJSON();
|
|
736
|
-
if (i !== e) return typeof i == "string" ? i : te(i, n);
|
|
737
|
-
} else if (Array.isArray(e)) return Jt(e, n);
|
|
738
|
-
return Ht(e, n);
|
|
739
|
-
}
|
|
740
|
-
function Xt(e) {
|
|
741
|
-
return typeof e.toJSON == "function";
|
|
742
|
-
}
|
|
743
|
-
function Ht(e, t) {
|
|
744
|
-
let n = Object.entries(e);
|
|
745
|
-
return n.length === 0 ? "{}" : t.length > 2 ? "[" + qt(e) + "]" : "{ " + n.map(([r, s]) => r + ": " + te(s, t)).join(", ") + " }";
|
|
746
|
-
}
|
|
747
|
-
function Jt(e, t) {
|
|
748
|
-
if (e.length === 0) return "[]";
|
|
749
|
-
if (t.length > 2) return "[Array]";
|
|
750
|
-
let n = Math.min(10, e.length), i = e.length - n, r = [];
|
|
751
|
-
for (let s = 0; s < n; ++s) r.push(te(e[s], t));
|
|
752
|
-
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
753
|
-
}
|
|
754
|
-
function qt(e) {
|
|
755
|
-
let t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
756
|
-
if (t === "Object" && typeof e.constructor == "function") {
|
|
757
|
-
let n = e.constructor.name;
|
|
758
|
-
if (typeof n == "string" && n !== "") return n;
|
|
759
|
-
}
|
|
760
|
-
return t;
|
|
761
|
-
}
|
|
762
|
-
function st(e) {
|
|
763
|
-
return it(e, B);
|
|
764
|
-
}
|
|
765
|
-
function ot(e, t) {
|
|
766
|
-
let n = new fe(e, t), i = n.parseDocument();
|
|
767
|
-
return Object.defineProperty(i, "tokenCount", {
|
|
750
|
+
function dt(e, t) {
|
|
751
|
+
let n = new De(e, t), r = n.parseDocument();
|
|
752
|
+
return Object.defineProperty(r, "tokenCount", {
|
|
768
753
|
enumerable: !1,
|
|
769
754
|
value: n.tokenCount
|
|
770
|
-
}),
|
|
755
|
+
}), r;
|
|
771
756
|
}
|
|
772
|
-
function
|
|
757
|
+
function se(e) {
|
|
773
758
|
let t = e.value;
|
|
774
|
-
return
|
|
759
|
+
return ft(e.kind) + (t != null ? ` "${t}"` : "");
|
|
775
760
|
}
|
|
776
|
-
function
|
|
777
|
-
return
|
|
761
|
+
function ft(e) {
|
|
762
|
+
return at(e) ? `"${e}"` : e;
|
|
778
763
|
}
|
|
779
|
-
function
|
|
764
|
+
function ei(e, t) {
|
|
780
765
|
let n = /* @__PURE__ */ new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
|
|
781
766
|
return Object.assign(n, t);
|
|
782
767
|
}
|
|
783
|
-
function
|
|
784
|
-
let t = [], { startToken: n, endToken:
|
|
785
|
-
for (let
|
|
786
|
-
...
|
|
768
|
+
function ti(e) {
|
|
769
|
+
let t = [], { startToken: n, endToken: r } = e.loc;
|
|
770
|
+
for (let i = n; i !== r; i = i.next) i.kind === "Comment" && t.push({
|
|
771
|
+
...i,
|
|
787
772
|
loc: {
|
|
788
|
-
start:
|
|
789
|
-
end:
|
|
773
|
+
start: i.start,
|
|
774
|
+
end: i.end
|
|
790
775
|
}
|
|
791
776
|
});
|
|
792
777
|
return t;
|
|
793
778
|
}
|
|
794
|
-
function
|
|
795
|
-
if (e
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
}
|
|
802
|
-
return e;
|
|
779
|
+
function ii(e) {
|
|
780
|
+
if (!(e instanceof R)) return e;
|
|
781
|
+
let { message: t, locations: [n] } = e;
|
|
782
|
+
return mt(t, {
|
|
783
|
+
loc: { start: n },
|
|
784
|
+
cause: e
|
|
785
|
+
});
|
|
803
786
|
}
|
|
804
|
-
function
|
|
787
|
+
function ri(e) {
|
|
805
788
|
let t;
|
|
806
789
|
try {
|
|
807
|
-
t =
|
|
790
|
+
t = oe(e, ni);
|
|
808
791
|
} catch (n) {
|
|
809
|
-
throw
|
|
792
|
+
throw ii(n);
|
|
810
793
|
}
|
|
811
|
-
return t.comments =
|
|
794
|
+
return t.comments = ti(t), t;
|
|
812
795
|
}
|
|
813
|
-
var
|
|
796
|
+
var Et, ae, ht, Ae, Tt, X, yt, ce, Ie, ge, Se, H, Oe, O, J, pe, S, u, l, z, ve, ke, Ce, Z, Re, At, T, le, Le, K, St, be, D, Pe, ee, te, we, Ve, Me, Ue, Be, Ge, Ke, je, Ye, qe, Qe, Xe, _e, He, Ut, R, et, Y, V, M, c, Gt, Kt, jt, Yt, qt, Qt, $t, Xt, Ht, Jt, Wt, zt, Zt, en, tn, nn, rn, sn, on, an, cn, pn, un, ln, dn, fn, mn, hn, En, Tn, xn, yn, Nn, Dn, _n, An, In, gn, Sn, On, vn, kn, Cn, Rn, Ln, bn, Fn, Pn, wn, Vn, ye, b, Ne, Bn, o, Q, ut, B, De, mt, ni, si, oi;
|
|
814
797
|
//#endregion
|
|
815
798
|
__esmMin((() => {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
for (var n in t)
|
|
799
|
+
Et = Object.defineProperty;
|
|
800
|
+
ae = (e, t) => {
|
|
801
|
+
for (var n in t) Et(e, n, {
|
|
819
802
|
get: t[n],
|
|
820
803
|
enumerable: !0
|
|
821
804
|
});
|
|
822
805
|
};
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
languages: () =>
|
|
826
|
-
options: () =>
|
|
827
|
-
parsers: () =>
|
|
828
|
-
printers: () =>
|
|
806
|
+
ht = {};
|
|
807
|
+
ae(ht, {
|
|
808
|
+
languages: () => Qe,
|
|
809
|
+
options: () => Xe,
|
|
810
|
+
parsers: () => _e,
|
|
811
|
+
printers: () => oi
|
|
829
812
|
});
|
|
830
|
-
|
|
831
|
-
|
|
813
|
+
Ae = (e, t) => (n, r, ...i) => n | 1 && r == null ? void 0 : (t.call(r) ?? r[e]).apply(r, i);
|
|
814
|
+
Tt = String.prototype.replaceAll ?? function(e, t) {
|
|
832
815
|
return e.global ? this.replace(e, t) : this.split(e).join(t);
|
|
833
|
-
},
|
|
834
|
-
if (typeof this == "string") return
|
|
816
|
+
}, X = Ae("replaceAll", function() {
|
|
817
|
+
if (typeof this == "string") return Tt;
|
|
835
818
|
});
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
type:
|
|
819
|
+
yt = () => {}, ce = yt;
|
|
820
|
+
Ie = "indent";
|
|
821
|
+
ge = "group";
|
|
822
|
+
Se = "if-break";
|
|
823
|
+
H = "line";
|
|
824
|
+
Oe = "break-parent";
|
|
825
|
+
O = ce, J = ce;
|
|
826
|
+
pe = { type: Oe };
|
|
827
|
+
S = { type: H }, u = {
|
|
828
|
+
type: H,
|
|
846
829
|
soft: !0
|
|
847
|
-
},
|
|
848
|
-
type:
|
|
830
|
+
}, l = [{
|
|
831
|
+
type: H,
|
|
849
832
|
hard: !0
|
|
850
|
-
},
|
|
851
|
-
|
|
852
|
-
|
|
833
|
+
}, pe];
|
|
834
|
+
z = W(" "), ve = W(",; "), ke = W(/[^\n\r]/);
|
|
835
|
+
Ce = (e) => e === `
|
|
853
836
|
` || e === "\r" || e === "\u2028" || e === "\u2029";
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
se = _t;
|
|
860
|
-
oe = class extends Error {
|
|
837
|
+
Z = Dt;
|
|
838
|
+
Re = _t;
|
|
839
|
+
At = () => !0;
|
|
840
|
+
T = gt;
|
|
841
|
+
le = class extends Error {
|
|
861
842
|
name = "UnexpectedNodeError";
|
|
862
|
-
constructor(t, n,
|
|
863
|
-
super(`Unexpected ${n} node ${
|
|
864
|
-
}
|
|
865
|
-
},
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
for (let e = 0; e <=
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
};
|
|
896
|
-
}
|
|
897
|
-
}, ce = {
|
|
843
|
+
constructor(t, n, r = "type") {
|
|
844
|
+
super(`Unexpected ${n} node ${r}: ${JSON.stringify(t[r])}.`), this.node = t;
|
|
845
|
+
}
|
|
846
|
+
}, Le = le;
|
|
847
|
+
K = null;
|
|
848
|
+
St = 10;
|
|
849
|
+
for (let e = 0; e <= St; e++) j();
|
|
850
|
+
be = Ot;
|
|
851
|
+
D = [
|
|
852
|
+
["name"],
|
|
853
|
+
["name", "value"],
|
|
854
|
+
["type"],
|
|
855
|
+
[
|
|
856
|
+
"description",
|
|
857
|
+
"name",
|
|
858
|
+
"directives"
|
|
859
|
+
],
|
|
860
|
+
[
|
|
861
|
+
"description",
|
|
862
|
+
"name",
|
|
863
|
+
"interfaces",
|
|
864
|
+
"directives",
|
|
865
|
+
"fields"
|
|
866
|
+
],
|
|
867
|
+
["name", "directives"],
|
|
868
|
+
[
|
|
869
|
+
"name",
|
|
870
|
+
"interfaces",
|
|
871
|
+
"directives",
|
|
872
|
+
"fields"
|
|
873
|
+
]
|
|
874
|
+
];
|
|
875
|
+
Pe = be({
|
|
898
876
|
Name: [],
|
|
899
877
|
Document: ["definitions"],
|
|
900
878
|
OperationDefinition: [
|
|
@@ -911,7 +889,7 @@ __esmMin((() => {
|
|
|
911
889
|
"defaultValue",
|
|
912
890
|
"directives"
|
|
913
891
|
],
|
|
914
|
-
Variable: [
|
|
892
|
+
Variable: D[0],
|
|
915
893
|
SelectionSet: ["selections"],
|
|
916
894
|
Field: [
|
|
917
895
|
"alias",
|
|
@@ -920,8 +898,13 @@ __esmMin((() => {
|
|
|
920
898
|
"directives",
|
|
921
899
|
"selectionSet"
|
|
922
900
|
],
|
|
923
|
-
Argument: [
|
|
924
|
-
|
|
901
|
+
Argument: D[1],
|
|
902
|
+
FragmentArgument: D[1],
|
|
903
|
+
FragmentSpread: [
|
|
904
|
+
"name",
|
|
905
|
+
"arguments",
|
|
906
|
+
"directives"
|
|
907
|
+
],
|
|
925
908
|
InlineFragment: [
|
|
926
909
|
"typeCondition",
|
|
927
910
|
"directives",
|
|
@@ -943,29 +926,19 @@ __esmMin((() => {
|
|
|
943
926
|
EnumValue: [],
|
|
944
927
|
ListValue: ["values"],
|
|
945
928
|
ObjectValue: ["fields"],
|
|
946
|
-
ObjectField: [
|
|
929
|
+
ObjectField: D[1],
|
|
947
930
|
Directive: ["name", "arguments"],
|
|
948
|
-
NamedType: [
|
|
949
|
-
ListType: [
|
|
950
|
-
NonNullType: [
|
|
931
|
+
NamedType: D[0],
|
|
932
|
+
ListType: D[2],
|
|
933
|
+
NonNullType: D[2],
|
|
951
934
|
SchemaDefinition: [
|
|
952
935
|
"description",
|
|
953
936
|
"directives",
|
|
954
937
|
"operationTypes"
|
|
955
938
|
],
|
|
956
|
-
OperationTypeDefinition: [
|
|
957
|
-
ScalarTypeDefinition: [
|
|
958
|
-
|
|
959
|
-
"name",
|
|
960
|
-
"directives"
|
|
961
|
-
],
|
|
962
|
-
ObjectTypeDefinition: [
|
|
963
|
-
"description",
|
|
964
|
-
"name",
|
|
965
|
-
"interfaces",
|
|
966
|
-
"directives",
|
|
967
|
-
"fields"
|
|
968
|
-
],
|
|
939
|
+
OperationTypeDefinition: D[2],
|
|
940
|
+
ScalarTypeDefinition: D[3],
|
|
941
|
+
ObjectTypeDefinition: D[4],
|
|
969
942
|
FieldDefinition: [
|
|
970
943
|
"description",
|
|
971
944
|
"name",
|
|
@@ -980,13 +953,7 @@ __esmMin((() => {
|
|
|
980
953
|
"defaultValue",
|
|
981
954
|
"directives"
|
|
982
955
|
],
|
|
983
|
-
InterfaceTypeDefinition: [
|
|
984
|
-
"description",
|
|
985
|
-
"name",
|
|
986
|
-
"interfaces",
|
|
987
|
-
"directives",
|
|
988
|
-
"fields"
|
|
989
|
-
],
|
|
956
|
+
InterfaceTypeDefinition: D[4],
|
|
990
957
|
UnionTypeDefinition: [
|
|
991
958
|
"description",
|
|
992
959
|
"name",
|
|
@@ -999,11 +966,7 @@ __esmMin((() => {
|
|
|
999
966
|
"directives",
|
|
1000
967
|
"values"
|
|
1001
968
|
],
|
|
1002
|
-
EnumValueDefinition: [
|
|
1003
|
-
"description",
|
|
1004
|
-
"name",
|
|
1005
|
-
"directives"
|
|
1006
|
-
],
|
|
969
|
+
EnumValueDefinition: D[3],
|
|
1007
970
|
InputObjectTypeDefinition: [
|
|
1008
971
|
"description",
|
|
1009
972
|
"name",
|
|
@@ -1014,22 +977,14 @@ __esmMin((() => {
|
|
|
1014
977
|
"description",
|
|
1015
978
|
"name",
|
|
1016
979
|
"arguments",
|
|
980
|
+
"directives",
|
|
1017
981
|
"locations"
|
|
1018
982
|
],
|
|
1019
983
|
SchemaExtension: ["directives", "operationTypes"],
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
"directives",
|
|
1025
|
-
"fields"
|
|
1026
|
-
],
|
|
1027
|
-
InterfaceTypeExtension: [
|
|
1028
|
-
"name",
|
|
1029
|
-
"interfaces",
|
|
1030
|
-
"directives",
|
|
1031
|
-
"fields"
|
|
1032
|
-
],
|
|
984
|
+
DirectiveExtension: D[5],
|
|
985
|
+
ScalarTypeExtension: D[5],
|
|
986
|
+
ObjectTypeExtension: D[6],
|
|
987
|
+
InterfaceTypeExtension: D[6],
|
|
1033
988
|
UnionTypeExtension: [
|
|
1034
989
|
"name",
|
|
1035
990
|
"directives",
|
|
@@ -1044,47 +999,27 @@ __esmMin((() => {
|
|
|
1044
999
|
"name",
|
|
1045
1000
|
"directives",
|
|
1046
1001
|
"fields"
|
|
1047
|
-
]
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
"argumentName"
|
|
1054
|
-
],
|
|
1055
|
-
DirectiveCoordinate: ["name"],
|
|
1056
|
-
DirectiveArgumentCoordinate: ["name", "argumentName"]
|
|
1057
|
-
};
|
|
1058
|
-
new Set(Object.keys(ce));
|
|
1059
|
-
(function(e) {
|
|
1060
|
-
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
1061
|
-
})(C || (C = {}));
|
|
1062
|
-
Re = { ...ce };
|
|
1063
|
-
for (let e of [
|
|
1064
|
-
"ArgumentCoordinate",
|
|
1065
|
-
"DirectiveArgumentCoordinate",
|
|
1066
|
-
"DirectiveCoordinate",
|
|
1067
|
-
"MemberCoordinate",
|
|
1068
|
-
"TypeCoordinate"
|
|
1069
|
-
]) delete Re[e];
|
|
1070
|
-
be = Ce(Re, "kind");
|
|
1071
|
-
J = (e) => e.loc.start, q = (e) => e.loc.end;
|
|
1072
|
-
Le = "format", Pe = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, we = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;
|
|
1073
|
-
Fe = (e) => we.test(e), Me = (e) => Pe.test(e), Ve = (e) => `# @${Le}
|
|
1002
|
+
]
|
|
1003
|
+
}, "kind");
|
|
1004
|
+
ee = (e) => e.loc.start, te = (e) => e.loc.end;
|
|
1005
|
+
fe.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
|
|
1006
|
+
we = "format", Ve = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/, Me = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/;
|
|
1007
|
+
Ue = (e) => Me.test(e), Be = (e) => Ve.test(e), Ge = (e) => `# @${we}
|
|
1074
1008
|
|
|
1075
1009
|
${e}`;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1010
|
+
Ke = kt;
|
|
1011
|
+
je = Ct;
|
|
1012
|
+
Ye = Rt;
|
|
1013
|
+
qe = {
|
|
1014
|
+
print: Lt,
|
|
1015
|
+
massageAstNode: fe,
|
|
1016
|
+
hasPrettierIgnore: Pt,
|
|
1017
|
+
insertPragma: Ge,
|
|
1018
|
+
printComment: Ft,
|
|
1019
|
+
canAttachComment: bt,
|
|
1020
|
+
getVisitorKeys: Pe
|
|
1086
1021
|
};
|
|
1087
|
-
|
|
1022
|
+
Qe = [{
|
|
1088
1023
|
name: "GraphQL",
|
|
1089
1024
|
type: "data",
|
|
1090
1025
|
aceMode: "graphqlschema",
|
|
@@ -1098,7 +1033,7 @@ ${e}`;
|
|
|
1098
1033
|
vscodeLanguageIds: ["graphql"],
|
|
1099
1034
|
linguistLanguageId: 139
|
|
1100
1035
|
}];
|
|
1101
|
-
|
|
1036
|
+
Xe = { bracketSpacing: {
|
|
1102
1037
|
bracketSpacing: {
|
|
1103
1038
|
category: "Common",
|
|
1104
1039
|
type: "boolean",
|
|
@@ -1158,18 +1093,20 @@ ${e}`;
|
|
|
1158
1093
|
description: "Enforce single attribute per line in HTML, Vue and JSX."
|
|
1159
1094
|
}
|
|
1160
1095
|
}.bracketSpacing };
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
let { nodes:
|
|
1168
|
-
super(t
|
|
1169
|
-
let
|
|
1170
|
-
this.
|
|
1171
|
-
let
|
|
1172
|
-
this.
|
|
1096
|
+
_e = {};
|
|
1097
|
+
ae(_e, { graphql: () => si });
|
|
1098
|
+
He = Mt;
|
|
1099
|
+
Ut = /\r\n|[\n\r]/g;
|
|
1100
|
+
R = class e extends Error {
|
|
1101
|
+
constructor(t, n = {}) {
|
|
1102
|
+
let { nodes: r, source: i, positions: s, path: a, originalError: p, cause: E, extensions: x } = n, v = "cause" in n;
|
|
1103
|
+
super(t, v || p != null ? { cause: v ? E : p } : void 0), this.name = "GraphQLError", this.path = a ?? void 0;
|
|
1104
|
+
let G = p ?? (E instanceof Error ? E : void 0);
|
|
1105
|
+
this.originalError = G, this.nodes = Ze(Array.isArray(r) ? r : r ? [r] : void 0);
|
|
1106
|
+
let k = Ze(this.nodes?.map((g) => g.loc).filter((g) => g != null));
|
|
1107
|
+
this.source = i ?? k?.[0]?.source, this.positions = s ?? k?.map((g) => g.start), this.locations = s && i ? s.map((g) => w(i, g)) : k?.map((g) => w(g.source, g.start));
|
|
1108
|
+
let C = Je(G?.extensions) ? G.extensions : void 0;
|
|
1109
|
+
this.extensions = x ?? C ?? Object.create(null), Object.defineProperties(this, {
|
|
1173
1110
|
message: {
|
|
1174
1111
|
writable: !0,
|
|
1175
1112
|
enumerable: !0
|
|
@@ -1179,11 +1116,11 @@ ${e}`;
|
|
|
1179
1116
|
source: { enumerable: !1 },
|
|
1180
1117
|
positions: { enumerable: !1 },
|
|
1181
1118
|
originalError: { enumerable: !1 }
|
|
1182
|
-
}),
|
|
1183
|
-
value:
|
|
1119
|
+
}), p?.stack != null ? Object.defineProperty(this, "stack", {
|
|
1120
|
+
value: p.stack,
|
|
1184
1121
|
writable: !0,
|
|
1185
1122
|
configurable: !0
|
|
1186
|
-
}) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", {
|
|
1123
|
+
}) : Error.captureStackTrace != null ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", {
|
|
1187
1124
|
value: Error().stack,
|
|
1188
1125
|
writable: !0,
|
|
1189
1126
|
configurable: !0
|
|
@@ -1196,10 +1133,10 @@ ${e}`;
|
|
|
1196
1133
|
let t = this.message;
|
|
1197
1134
|
if (this.nodes) for (let n of this.nodes) n.loc && (t += `
|
|
1198
1135
|
|
|
1199
|
-
` +
|
|
1136
|
+
` + Ee(n.loc));
|
|
1200
1137
|
else if (this.source && this.locations) for (let n of this.locations) t += `
|
|
1201
1138
|
|
|
1202
|
-
` +
|
|
1139
|
+
` + ne(this.source, n);
|
|
1203
1140
|
return t;
|
|
1204
1141
|
}
|
|
1205
1142
|
toJSON() {
|
|
@@ -1207,18 +1144,160 @@ ${e}`;
|
|
|
1207
1144
|
return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
|
|
1208
1145
|
}
|
|
1209
1146
|
};
|
|
1210
|
-
(
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1147
|
+
et = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
1148
|
+
Y = class {
|
|
1149
|
+
constructor(t, n, r) {
|
|
1150
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
|
|
1151
|
+
}
|
|
1152
|
+
get [Symbol.toStringTag]() {
|
|
1153
|
+
return "Location";
|
|
1154
|
+
}
|
|
1155
|
+
toJSON() {
|
|
1156
|
+
return {
|
|
1157
|
+
start: this.start,
|
|
1158
|
+
end: this.end
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
}, V = class {
|
|
1162
|
+
constructor(t, n, r, i, s, a) {
|
|
1163
|
+
this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = a, this.prev = null, this.next = null;
|
|
1164
|
+
}
|
|
1165
|
+
get [Symbol.toStringTag]() {
|
|
1166
|
+
return "Token";
|
|
1167
|
+
}
|
|
1168
|
+
toJSON() {
|
|
1169
|
+
return {
|
|
1170
|
+
kind: this.kind,
|
|
1171
|
+
value: this.value,
|
|
1172
|
+
line: this.line,
|
|
1173
|
+
column: this.column
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
};
|
|
1177
|
+
M = {
|
|
1178
|
+
QUERY: "query",
|
|
1179
|
+
MUTATION: "mutation",
|
|
1180
|
+
SUBSCRIPTION: "subscription"
|
|
1181
|
+
};
|
|
1182
|
+
c = {};
|
|
1183
|
+
ae(c, {
|
|
1184
|
+
ARGUMENT: () => $t,
|
|
1185
|
+
ARGUMENT_COORDINATE: () => Pn,
|
|
1186
|
+
BOOLEAN: () => nn,
|
|
1187
|
+
DIRECTIVE: () => pn,
|
|
1188
|
+
DIRECTIVE_ARGUMENT_COORDINATE: () => Vn,
|
|
1189
|
+
DIRECTIVE_COORDINATE: () => wn,
|
|
1190
|
+
DIRECTIVE_DEFINITION: () => In,
|
|
1191
|
+
DIRECTIVE_EXTENSION: () => Sn,
|
|
1192
|
+
DOCUMENT: () => Kt,
|
|
1193
|
+
ENUM: () => sn,
|
|
1194
|
+
ENUM_TYPE_DEFINITION: () => Dn,
|
|
1195
|
+
ENUM_TYPE_EXTENSION: () => Rn,
|
|
1196
|
+
ENUM_VALUE_DEFINITION: () => _n,
|
|
1197
|
+
FIELD: () => Qt,
|
|
1198
|
+
FIELD_DEFINITION: () => Tn,
|
|
1199
|
+
FLOAT: () => en,
|
|
1200
|
+
FRAGMENT_ARGUMENT: () => Xt,
|
|
1201
|
+
FRAGMENT_DEFINITION: () => Wt,
|
|
1202
|
+
FRAGMENT_SPREAD: () => Ht,
|
|
1203
|
+
INLINE_FRAGMENT: () => Jt,
|
|
1204
|
+
INPUT_OBJECT_TYPE_DEFINITION: () => An,
|
|
1205
|
+
INPUT_OBJECT_TYPE_EXTENSION: () => Ln,
|
|
1206
|
+
INPUT_VALUE_DEFINITION: () => xn,
|
|
1207
|
+
INT: () => Zt,
|
|
1208
|
+
INTERFACE_TYPE_DEFINITION: () => yn,
|
|
1209
|
+
INTERFACE_TYPE_EXTENSION: () => kn,
|
|
1210
|
+
LIST: () => on,
|
|
1211
|
+
LIST_TYPE: () => ln,
|
|
1212
|
+
MEMBER_COORDINATE: () => Fn,
|
|
1213
|
+
NAME: () => Gt,
|
|
1214
|
+
NAMED_TYPE: () => un,
|
|
1215
|
+
NON_NULL_TYPE: () => dn,
|
|
1216
|
+
NULL: () => rn,
|
|
1217
|
+
OBJECT: () => an,
|
|
1218
|
+
OBJECT_FIELD: () => cn,
|
|
1219
|
+
OBJECT_TYPE_DEFINITION: () => En,
|
|
1220
|
+
OBJECT_TYPE_EXTENSION: () => vn,
|
|
1221
|
+
OPERATION_DEFINITION: () => jt,
|
|
1222
|
+
OPERATION_TYPE_DEFINITION: () => mn,
|
|
1223
|
+
SCALAR_TYPE_DEFINITION: () => hn,
|
|
1224
|
+
SCALAR_TYPE_EXTENSION: () => On,
|
|
1225
|
+
SCHEMA_DEFINITION: () => fn,
|
|
1226
|
+
SCHEMA_EXTENSION: () => gn,
|
|
1227
|
+
SELECTION_SET: () => qt,
|
|
1228
|
+
STRING: () => tn,
|
|
1229
|
+
TYPE_COORDINATE: () => bn,
|
|
1230
|
+
UNION_TYPE_DEFINITION: () => Nn,
|
|
1231
|
+
UNION_TYPE_EXTENSION: () => Cn,
|
|
1232
|
+
VARIABLE: () => zt,
|
|
1233
|
+
VARIABLE_DEFINITION: () => Yt
|
|
1234
|
+
});
|
|
1235
|
+
Gt = "Name", Kt = "Document", jt = "OperationDefinition", Yt = "VariableDefinition", qt = "SelectionSet", Qt = "Field", $t = "Argument", Xt = "FragmentArgument", Ht = "FragmentSpread", Jt = "InlineFragment", Wt = "FragmentDefinition", zt = "Variable", Zt = "IntValue", en = "FloatValue", tn = "StringValue", nn = "BooleanValue", rn = "NullValue", sn = "EnumValue", on = "ListValue", an = "ObjectValue", cn = "ObjectField", pn = "Directive", un = "NamedType", ln = "ListType", dn = "NonNullType", fn = "SchemaDefinition", mn = "OperationTypeDefinition", hn = "ScalarTypeDefinition", En = "ObjectTypeDefinition", Tn = "FieldDefinition", xn = "InputValueDefinition", yn = "InterfaceTypeDefinition", Nn = "UnionTypeDefinition", Dn = "EnumTypeDefinition", _n = "EnumValueDefinition", An = "InputObjectTypeDefinition", In = "DirectiveDefinition", gn = "SchemaExtension", Sn = "DirectiveExtension", On = "ScalarTypeExtension", vn = "ObjectTypeExtension", kn = "InterfaceTypeExtension", Cn = "UnionTypeExtension", Rn = "EnumTypeExtension", Ln = "InputObjectTypeExtension", bn = "TypeCoordinate", Fn = "MemberCoordinate", Pn = "ArgumentCoordinate", wn = "DirectiveCoordinate", Vn = "DirectiveArgumentCoordinate";
|
|
1236
|
+
ye = {
|
|
1237
|
+
QUERY: "QUERY",
|
|
1238
|
+
MUTATION: "MUTATION",
|
|
1239
|
+
SUBSCRIPTION: "SUBSCRIPTION",
|
|
1240
|
+
FIELD: "FIELD",
|
|
1241
|
+
FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION",
|
|
1242
|
+
FRAGMENT_SPREAD: "FRAGMENT_SPREAD",
|
|
1243
|
+
INLINE_FRAGMENT: "INLINE_FRAGMENT",
|
|
1244
|
+
VARIABLE_DEFINITION: "VARIABLE_DEFINITION",
|
|
1245
|
+
FRAGMENT_VARIABLE_DEFINITION: "FRAGMENT_VARIABLE_DEFINITION",
|
|
1246
|
+
SCHEMA: "SCHEMA",
|
|
1247
|
+
SCALAR: "SCALAR",
|
|
1248
|
+
OBJECT: "OBJECT",
|
|
1249
|
+
FIELD_DEFINITION: "FIELD_DEFINITION",
|
|
1250
|
+
ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION",
|
|
1251
|
+
INTERFACE: "INTERFACE",
|
|
1252
|
+
UNION: "UNION",
|
|
1253
|
+
ENUM: "ENUM",
|
|
1254
|
+
ENUM_VALUE: "ENUM_VALUE",
|
|
1255
|
+
INPUT_OBJECT: "INPUT_OBJECT",
|
|
1256
|
+
INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION",
|
|
1257
|
+
DIRECTIVE_DEFINITION: "DIRECTIVE_DEFINITION"
|
|
1258
|
+
};
|
|
1259
|
+
b = Un(), Ne = b?.tracingChannel("graphql:parse");
|
|
1260
|
+
b?.tracingChannel("graphql:validate");
|
|
1261
|
+
b?.tracingChannel("graphql:execute");
|
|
1262
|
+
b?.tracingChannel("graphql:execute:variableCoercion");
|
|
1263
|
+
b?.tracingChannel("graphql:execute:rootSelectionSet");
|
|
1264
|
+
b?.tracingChannel("graphql:subscribe");
|
|
1265
|
+
b?.tracingChannel("graphql:resolve");
|
|
1266
|
+
Bn = [
|
|
1267
|
+
"start",
|
|
1268
|
+
"end",
|
|
1269
|
+
"asyncStart",
|
|
1270
|
+
"asyncEnd",
|
|
1271
|
+
"error"
|
|
1272
|
+
];
|
|
1273
|
+
o = {
|
|
1274
|
+
SOF: "<SOF>",
|
|
1275
|
+
EOF: "<EOF>",
|
|
1276
|
+
BANG: "!",
|
|
1277
|
+
DOLLAR: "$",
|
|
1278
|
+
AMP: "&",
|
|
1279
|
+
PAREN_L: "(",
|
|
1280
|
+
PAREN_R: ")",
|
|
1281
|
+
DOT: ".",
|
|
1282
|
+
SPREAD: "...",
|
|
1283
|
+
COLON: ":",
|
|
1284
|
+
EQUALS: "=",
|
|
1285
|
+
AT: "@",
|
|
1286
|
+
BRACKET_L: "[",
|
|
1287
|
+
BRACKET_R: "]",
|
|
1288
|
+
BRACE_L: "{",
|
|
1289
|
+
PIPE: "|",
|
|
1290
|
+
BRACE_R: "}",
|
|
1291
|
+
NAME: "Name",
|
|
1292
|
+
INT: "Int",
|
|
1293
|
+
FLOAT: "Float",
|
|
1294
|
+
STRING: "String",
|
|
1295
|
+
BLOCK_STRING: "BlockString",
|
|
1296
|
+
COMMENT: "Comment"
|
|
1297
|
+
};
|
|
1298
|
+
Q = class {
|
|
1220
1299
|
constructor(t) {
|
|
1221
|
-
let n = new
|
|
1300
|
+
let n = new V(o.SOF, 0, 0, 0, 0);
|
|
1222
1301
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
1223
1302
|
}
|
|
1224
1303
|
get [Symbol.toStringTag]() {
|
|
@@ -1232,58 +1311,33 @@ ${e}`;
|
|
|
1232
1311
|
if (t.kind !== o.EOF) do
|
|
1233
1312
|
if (t.next) t = t.next;
|
|
1234
1313
|
else {
|
|
1235
|
-
let n =
|
|
1314
|
+
let n = Gn(this, t.end);
|
|
1236
1315
|
t.next = n, n.prev = t, t = n;
|
|
1237
1316
|
}
|
|
1238
1317
|
while (t.kind === o.COMMENT);
|
|
1239
1318
|
return t;
|
|
1240
1319
|
}
|
|
1241
1320
|
};
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
} : function(t, n) {
|
|
1245
|
-
if (t instanceof n) return !0;
|
|
1246
|
-
if (typeof t == "object" && t !== null) {
|
|
1247
|
-
var i;
|
|
1248
|
-
let r = n.prototype[Symbol.toStringTag];
|
|
1249
|
-
if (r === (Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name)) {
|
|
1250
|
-
let a = ee(t);
|
|
1251
|
-
throw new Error(`Cannot use ${r} "${a}" from another module or realm.
|
|
1252
|
-
|
|
1253
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
1254
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
1255
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
1256
|
-
|
|
1257
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
1258
|
-
|
|
1259
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
1260
|
-
versions may have different capabilities and behavior. The data from one
|
|
1261
|
-
version used in the function from another could produce confusing and
|
|
1262
|
-
spurious results.`);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
return !1;
|
|
1266
|
-
};
|
|
1267
|
-
B = class {
|
|
1268
|
-
constructor(t, n = "GraphQL request", i = {
|
|
1321
|
+
ut = Symbol("Source"), B = class {
|
|
1322
|
+
constructor(t, n = "GraphQL request", r = {
|
|
1269
1323
|
line: 1,
|
|
1270
1324
|
column: 1
|
|
1271
1325
|
}) {
|
|
1272
|
-
|
|
1326
|
+
this.__kind = ut, this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || Te(!1, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || Te(!1, "column in locationOffset is 1-indexed and must be positive.");
|
|
1273
1327
|
}
|
|
1274
1328
|
get [Symbol.toStringTag]() {
|
|
1275
1329
|
return "Source";
|
|
1276
1330
|
}
|
|
1277
1331
|
};
|
|
1278
|
-
|
|
1332
|
+
De = class {
|
|
1279
1333
|
constructor(t, n = {}) {
|
|
1280
|
-
let { lexer:
|
|
1281
|
-
if (
|
|
1334
|
+
let { lexer: r, ...i } = n;
|
|
1335
|
+
if (r) this._lexer = r;
|
|
1282
1336
|
else {
|
|
1283
|
-
let s =
|
|
1284
|
-
this._lexer = new
|
|
1337
|
+
let s = lt(t) ? t : new B(t);
|
|
1338
|
+
this._lexer = new Q(s);
|
|
1285
1339
|
}
|
|
1286
|
-
this._options =
|
|
1340
|
+
this._options = i, this._tokenCounter = 0;
|
|
1287
1341
|
}
|
|
1288
1342
|
get tokenCount() {
|
|
1289
1343
|
return this._tokenCounter;
|
|
@@ -1304,7 +1358,7 @@ spurious results.`);
|
|
|
1304
1358
|
parseDefinition() {
|
|
1305
1359
|
if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
|
|
1306
1360
|
let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
1307
|
-
if (t && n.kind === o.BRACE_L) throw
|
|
1361
|
+
if (t && n.kind === o.BRACE_L) throw f(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are not supported on shorthand queries.");
|
|
1308
1362
|
if (n.kind === o.NAME) {
|
|
1309
1363
|
switch (n.value) {
|
|
1310
1364
|
case "schema": return this.parseSchemaDefinition();
|
|
@@ -1322,10 +1376,8 @@ spurious results.`);
|
|
|
1322
1376
|
case "subscription": return this.parseOperationDefinition();
|
|
1323
1377
|
case "fragment": return this.parseFragmentDefinition();
|
|
1324
1378
|
}
|
|
1325
|
-
if (t) throw
|
|
1326
|
-
|
|
1327
|
-
case "extend": return this.parseTypeSystemExtension();
|
|
1328
|
-
}
|
|
1379
|
+
if (t) throw f(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
|
|
1380
|
+
if (n.value === "extend") return this.parseTypeSystemExtension();
|
|
1329
1381
|
}
|
|
1330
1382
|
throw this.unexpected(n);
|
|
1331
1383
|
}
|
|
@@ -1333,19 +1385,19 @@ spurious results.`);
|
|
|
1333
1385
|
let t = this._lexer.token;
|
|
1334
1386
|
if (this.peek(o.BRACE_L)) return this.node(t, {
|
|
1335
1387
|
kind: c.OPERATION_DEFINITION,
|
|
1336
|
-
operation:
|
|
1388
|
+
operation: M.QUERY,
|
|
1337
1389
|
description: void 0,
|
|
1338
1390
|
name: void 0,
|
|
1339
|
-
variableDefinitions:
|
|
1340
|
-
directives:
|
|
1391
|
+
variableDefinitions: void 0,
|
|
1392
|
+
directives: void 0,
|
|
1341
1393
|
selectionSet: this.parseSelectionSet()
|
|
1342
1394
|
});
|
|
1343
|
-
let n = this.parseDescription(),
|
|
1344
|
-
return this.peek(o.NAME) && (
|
|
1395
|
+
let n = this.parseDescription(), r = this.parseOperationType(), i;
|
|
1396
|
+
return this.peek(o.NAME) && (i = this.parseName()), this.node(t, {
|
|
1345
1397
|
kind: c.OPERATION_DEFINITION,
|
|
1346
|
-
operation:
|
|
1398
|
+
operation: r,
|
|
1347
1399
|
description: n,
|
|
1348
|
-
name:
|
|
1400
|
+
name: i,
|
|
1349
1401
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1350
1402
|
directives: this.parseDirectives(!1),
|
|
1351
1403
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1354,9 +1406,9 @@ spurious results.`);
|
|
|
1354
1406
|
parseOperationType() {
|
|
1355
1407
|
let t = this.expectToken(o.NAME);
|
|
1356
1408
|
switch (t.value) {
|
|
1357
|
-
case "query": return
|
|
1358
|
-
case "mutation": return
|
|
1359
|
-
case "subscription": return
|
|
1409
|
+
case "query": return M.QUERY;
|
|
1410
|
+
case "mutation": return M.MUTATION;
|
|
1411
|
+
case "subscription": return M.SUBSCRIPTION;
|
|
1360
1412
|
}
|
|
1361
1413
|
throw this.unexpected(t);
|
|
1362
1414
|
}
|
|
@@ -1390,11 +1442,11 @@ spurious results.`);
|
|
|
1390
1442
|
return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
|
|
1391
1443
|
}
|
|
1392
1444
|
parseField() {
|
|
1393
|
-
let t = this._lexer.token, n = this.parseName(),
|
|
1394
|
-
return this.expectOptionalToken(o.COLON) ? (
|
|
1445
|
+
let t = this._lexer.token, n = this.parseName(), r, i;
|
|
1446
|
+
return this.expectOptionalToken(o.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
|
|
1395
1447
|
kind: c.FIELD,
|
|
1396
|
-
alias:
|
|
1397
|
-
name:
|
|
1448
|
+
alias: r,
|
|
1449
|
+
name: i,
|
|
1398
1450
|
arguments: this.parseArguments(!1),
|
|
1399
1451
|
directives: this.parseDirectives(!1),
|
|
1400
1452
|
selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
@@ -1404,26 +1456,47 @@ spurious results.`);
|
|
|
1404
1456
|
let n = t ? this.parseConstArgument : this.parseArgument;
|
|
1405
1457
|
return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
|
|
1406
1458
|
}
|
|
1459
|
+
parseFragmentArguments() {
|
|
1460
|
+
let t = this.parseFragmentArgument;
|
|
1461
|
+
return this.optionalMany(o.PAREN_L, t, o.PAREN_R);
|
|
1462
|
+
}
|
|
1407
1463
|
parseArgument(t = !1) {
|
|
1408
|
-
let n = this._lexer.token,
|
|
1464
|
+
let n = this._lexer.token, r = this.parseName();
|
|
1409
1465
|
return this.expectToken(o.COLON), this.node(n, {
|
|
1410
1466
|
kind: c.ARGUMENT,
|
|
1411
|
-
name:
|
|
1467
|
+
name: r,
|
|
1412
1468
|
value: this.parseValueLiteral(t)
|
|
1413
1469
|
});
|
|
1414
1470
|
}
|
|
1415
1471
|
parseConstArgument() {
|
|
1416
1472
|
return this.parseArgument(!0);
|
|
1417
1473
|
}
|
|
1474
|
+
parseFragmentArgument() {
|
|
1475
|
+
let t = this._lexer.token, n = this.parseName();
|
|
1476
|
+
return this.expectToken(o.COLON), this.node(t, {
|
|
1477
|
+
kind: c.FRAGMENT_ARGUMENT,
|
|
1478
|
+
name: n,
|
|
1479
|
+
value: this.parseValueLiteral(!1)
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1418
1482
|
parseFragment() {
|
|
1419
1483
|
let t = this._lexer.token;
|
|
1420
1484
|
this.expectToken(o.SPREAD);
|
|
1421
1485
|
let n = this.expectOptionalKeyword("on");
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1486
|
+
if (!n && this.peek(o.NAME)) {
|
|
1487
|
+
let r = this.parseFragmentName();
|
|
1488
|
+
return this.peek(o.PAREN_L) && this._options.experimentalFragmentArguments ? this.node(t, {
|
|
1489
|
+
kind: c.FRAGMENT_SPREAD,
|
|
1490
|
+
name: r,
|
|
1491
|
+
arguments: this.parseFragmentArguments(),
|
|
1492
|
+
directives: this.parseDirectives(!1)
|
|
1493
|
+
}) : this.node(t, {
|
|
1494
|
+
kind: c.FRAGMENT_SPREAD,
|
|
1495
|
+
name: r,
|
|
1496
|
+
directives: this.parseDirectives(!1)
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
return this.node(t, {
|
|
1427
1500
|
kind: c.INLINE_FRAGMENT,
|
|
1428
1501
|
typeCondition: n ? this.parseNamedType() : void 0,
|
|
1429
1502
|
directives: this.parseDirectives(!1),
|
|
@@ -1432,7 +1505,7 @@ spurious results.`);
|
|
|
1432
1505
|
}
|
|
1433
1506
|
parseFragmentDefinition() {
|
|
1434
1507
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1435
|
-
return this.expectKeyword("fragment"), this._options.
|
|
1508
|
+
return this.expectKeyword("fragment"), this._options.experimentalFragmentArguments === !0 ? this.node(t, {
|
|
1436
1509
|
kind: c.FRAGMENT_DEFINITION,
|
|
1437
1510
|
description: n,
|
|
1438
1511
|
name: this.parseFragmentName(),
|
|
@@ -1485,8 +1558,8 @@ spurious results.`);
|
|
|
1485
1558
|
}
|
|
1486
1559
|
case o.DOLLAR:
|
|
1487
1560
|
if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
|
|
1488
|
-
let
|
|
1489
|
-
throw
|
|
1561
|
+
let r = this._lexer.token.value;
|
|
1562
|
+
throw f(this._lexer.source, n.start, `Unexpected variable "$${r}" in constant value.`);
|
|
1490
1563
|
} else throw this.unexpected(n);
|
|
1491
1564
|
return this.parseVariable();
|
|
1492
1565
|
default: throw this.unexpected();
|
|
@@ -1518,17 +1591,17 @@ spurious results.`);
|
|
|
1518
1591
|
});
|
|
1519
1592
|
}
|
|
1520
1593
|
parseObjectField(t) {
|
|
1521
|
-
let n = this._lexer.token,
|
|
1594
|
+
let n = this._lexer.token, r = this.parseName();
|
|
1522
1595
|
return this.expectToken(o.COLON), this.node(n, {
|
|
1523
1596
|
kind: c.OBJECT_FIELD,
|
|
1524
|
-
name:
|
|
1597
|
+
name: r,
|
|
1525
1598
|
value: this.parseValueLiteral(t)
|
|
1526
1599
|
});
|
|
1527
1600
|
}
|
|
1528
1601
|
parseDirectives(t) {
|
|
1529
1602
|
let n = [];
|
|
1530
1603
|
for (; this.peek(o.AT);) n.push(this.parseDirective(t));
|
|
1531
|
-
return n;
|
|
1604
|
+
if (n.length) return n;
|
|
1532
1605
|
}
|
|
1533
1606
|
parseConstDirectives() {
|
|
1534
1607
|
return this.parseDirectives(!0);
|
|
@@ -1544,10 +1617,10 @@ spurious results.`);
|
|
|
1544
1617
|
parseTypeReference() {
|
|
1545
1618
|
let t = this._lexer.token, n;
|
|
1546
1619
|
if (this.expectOptionalToken(o.BRACKET_L)) {
|
|
1547
|
-
let
|
|
1620
|
+
let r = this.parseTypeReference();
|
|
1548
1621
|
this.expectToken(o.BRACKET_R), n = this.node(t, {
|
|
1549
1622
|
kind: c.LIST_TYPE,
|
|
1550
|
-
type:
|
|
1623
|
+
type: r
|
|
1551
1624
|
});
|
|
1552
1625
|
} else n = this.parseNamedType();
|
|
1553
1626
|
return this.expectOptionalToken(o.BANG) ? this.node(t, {
|
|
@@ -1570,63 +1643,63 @@ spurious results.`);
|
|
|
1570
1643
|
parseSchemaDefinition() {
|
|
1571
1644
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1572
1645
|
this.expectKeyword("schema");
|
|
1573
|
-
let
|
|
1646
|
+
let r = this.parseConstDirectives(), i = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
|
|
1574
1647
|
return this.node(t, {
|
|
1575
1648
|
kind: c.SCHEMA_DEFINITION,
|
|
1576
1649
|
description: n,
|
|
1577
|
-
directives:
|
|
1578
|
-
operationTypes:
|
|
1650
|
+
directives: r,
|
|
1651
|
+
operationTypes: i
|
|
1579
1652
|
});
|
|
1580
1653
|
}
|
|
1581
1654
|
parseOperationTypeDefinition() {
|
|
1582
1655
|
let t = this._lexer.token, n = this.parseOperationType();
|
|
1583
1656
|
this.expectToken(o.COLON);
|
|
1584
|
-
let
|
|
1657
|
+
let r = this.parseNamedType();
|
|
1585
1658
|
return this.node(t, {
|
|
1586
1659
|
kind: c.OPERATION_TYPE_DEFINITION,
|
|
1587
1660
|
operation: n,
|
|
1588
|
-
type:
|
|
1661
|
+
type: r
|
|
1589
1662
|
});
|
|
1590
1663
|
}
|
|
1591
1664
|
parseScalarTypeDefinition() {
|
|
1592
1665
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1593
1666
|
this.expectKeyword("scalar");
|
|
1594
|
-
let
|
|
1667
|
+
let r = this.parseName(), i = this.parseConstDirectives();
|
|
1595
1668
|
return this.node(t, {
|
|
1596
1669
|
kind: c.SCALAR_TYPE_DEFINITION,
|
|
1597
1670
|
description: n,
|
|
1598
|
-
name:
|
|
1599
|
-
directives:
|
|
1671
|
+
name: r,
|
|
1672
|
+
directives: i
|
|
1600
1673
|
});
|
|
1601
1674
|
}
|
|
1602
1675
|
parseObjectTypeDefinition() {
|
|
1603
1676
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1604
1677
|
this.expectKeyword("type");
|
|
1605
|
-
let
|
|
1678
|
+
let r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1606
1679
|
return this.node(t, {
|
|
1607
1680
|
kind: c.OBJECT_TYPE_DEFINITION,
|
|
1608
1681
|
description: n,
|
|
1609
|
-
name:
|
|
1610
|
-
interfaces:
|
|
1682
|
+
name: r,
|
|
1683
|
+
interfaces: i,
|
|
1611
1684
|
directives: s,
|
|
1612
1685
|
fields: a
|
|
1613
1686
|
});
|
|
1614
1687
|
}
|
|
1615
1688
|
parseImplementsInterfaces() {
|
|
1616
|
-
return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) :
|
|
1689
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : void 0;
|
|
1617
1690
|
}
|
|
1618
1691
|
parseFieldsDefinition() {
|
|
1619
1692
|
return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
|
|
1620
1693
|
}
|
|
1621
1694
|
parseFieldDefinition() {
|
|
1622
|
-
let t = this._lexer.token, n = this.parseDescription(),
|
|
1695
|
+
let t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
|
|
1623
1696
|
this.expectToken(o.COLON);
|
|
1624
1697
|
let s = this.parseTypeReference(), a = this.parseConstDirectives();
|
|
1625
1698
|
return this.node(t, {
|
|
1626
1699
|
kind: c.FIELD_DEFINITION,
|
|
1627
1700
|
description: n,
|
|
1628
|
-
name:
|
|
1629
|
-
arguments:
|
|
1701
|
+
name: r,
|
|
1702
|
+
arguments: i,
|
|
1630
1703
|
type: s,
|
|
1631
1704
|
directives: a
|
|
1632
1705
|
});
|
|
@@ -1635,16 +1708,16 @@ spurious results.`);
|
|
|
1635
1708
|
return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
|
|
1636
1709
|
}
|
|
1637
1710
|
parseInputValueDef() {
|
|
1638
|
-
let t = this._lexer.token, n = this.parseDescription(),
|
|
1711
|
+
let t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
|
|
1639
1712
|
this.expectToken(o.COLON);
|
|
1640
|
-
let
|
|
1713
|
+
let i = this.parseTypeReference(), s;
|
|
1641
1714
|
this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1642
1715
|
let a = this.parseConstDirectives();
|
|
1643
1716
|
return this.node(t, {
|
|
1644
1717
|
kind: c.INPUT_VALUE_DEFINITION,
|
|
1645
1718
|
description: n,
|
|
1646
|
-
name:
|
|
1647
|
-
type:
|
|
1719
|
+
name: r,
|
|
1720
|
+
type: i,
|
|
1648
1721
|
defaultValue: s,
|
|
1649
1722
|
directives: a
|
|
1650
1723
|
});
|
|
@@ -1652,12 +1725,12 @@ spurious results.`);
|
|
|
1652
1725
|
parseInterfaceTypeDefinition() {
|
|
1653
1726
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1654
1727
|
this.expectKeyword("interface");
|
|
1655
|
-
let
|
|
1728
|
+
let r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1656
1729
|
return this.node(t, {
|
|
1657
1730
|
kind: c.INTERFACE_TYPE_DEFINITION,
|
|
1658
1731
|
description: n,
|
|
1659
|
-
name:
|
|
1660
|
-
interfaces:
|
|
1732
|
+
name: r,
|
|
1733
|
+
interfaces: i,
|
|
1661
1734
|
directives: s,
|
|
1662
1735
|
fields: a
|
|
1663
1736
|
});
|
|
@@ -1665,27 +1738,27 @@ spurious results.`);
|
|
|
1665
1738
|
parseUnionTypeDefinition() {
|
|
1666
1739
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1667
1740
|
this.expectKeyword("union");
|
|
1668
|
-
let
|
|
1741
|
+
let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1669
1742
|
return this.node(t, {
|
|
1670
1743
|
kind: c.UNION_TYPE_DEFINITION,
|
|
1671
1744
|
description: n,
|
|
1672
|
-
name:
|
|
1673
|
-
directives:
|
|
1745
|
+
name: r,
|
|
1746
|
+
directives: i,
|
|
1674
1747
|
types: s
|
|
1675
1748
|
});
|
|
1676
1749
|
}
|
|
1677
1750
|
parseUnionMemberTypes() {
|
|
1678
|
-
return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) :
|
|
1751
|
+
return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : void 0;
|
|
1679
1752
|
}
|
|
1680
1753
|
parseEnumTypeDefinition() {
|
|
1681
1754
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1682
1755
|
this.expectKeyword("enum");
|
|
1683
|
-
let
|
|
1756
|
+
let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1684
1757
|
return this.node(t, {
|
|
1685
1758
|
kind: c.ENUM_TYPE_DEFINITION,
|
|
1686
1759
|
description: n,
|
|
1687
|
-
name:
|
|
1688
|
-
directives:
|
|
1760
|
+
name: r,
|
|
1761
|
+
directives: i,
|
|
1689
1762
|
values: s
|
|
1690
1763
|
});
|
|
1691
1764
|
}
|
|
@@ -1693,27 +1766,27 @@ spurious results.`);
|
|
|
1693
1766
|
return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
|
|
1694
1767
|
}
|
|
1695
1768
|
parseEnumValueDefinition() {
|
|
1696
|
-
let t = this._lexer.token, n = this.parseDescription(),
|
|
1769
|
+
let t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
|
|
1697
1770
|
return this.node(t, {
|
|
1698
1771
|
kind: c.ENUM_VALUE_DEFINITION,
|
|
1699
1772
|
description: n,
|
|
1700
|
-
name:
|
|
1701
|
-
directives:
|
|
1773
|
+
name: r,
|
|
1774
|
+
directives: i
|
|
1702
1775
|
});
|
|
1703
1776
|
}
|
|
1704
1777
|
parseEnumValueName() {
|
|
1705
|
-
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw
|
|
1778
|
+
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw f(this._lexer.source, this._lexer.token.start, `${se(this._lexer.token)} is reserved and cannot be used for an enum value.`);
|
|
1706
1779
|
return this.parseName();
|
|
1707
1780
|
}
|
|
1708
1781
|
parseInputObjectTypeDefinition() {
|
|
1709
1782
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1710
1783
|
this.expectKeyword("input");
|
|
1711
|
-
let
|
|
1784
|
+
let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1712
1785
|
return this.node(t, {
|
|
1713
1786
|
kind: c.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1714
1787
|
description: n,
|
|
1715
|
-
name:
|
|
1716
|
-
directives:
|
|
1788
|
+
name: r,
|
|
1789
|
+
directives: i,
|
|
1717
1790
|
fields: s
|
|
1718
1791
|
});
|
|
1719
1792
|
}
|
|
@@ -1730,106 +1803,119 @@ spurious results.`);
|
|
|
1730
1803
|
case "union": return this.parseUnionTypeExtension();
|
|
1731
1804
|
case "enum": return this.parseEnumTypeExtension();
|
|
1732
1805
|
case "input": return this.parseInputObjectTypeExtension();
|
|
1806
|
+
case "directive": return this.parseDirectiveExtension();
|
|
1733
1807
|
}
|
|
1734
1808
|
throw this.unexpected(t);
|
|
1735
1809
|
}
|
|
1736
1810
|
parseSchemaExtension() {
|
|
1737
1811
|
let t = this._lexer.token;
|
|
1738
1812
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1739
|
-
let n = this.parseConstDirectives(),
|
|
1740
|
-
if (n
|
|
1813
|
+
let n = this.parseConstDirectives(), r = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
|
|
1814
|
+
if (n === void 0 && r === void 0) throw this.unexpected();
|
|
1741
1815
|
return this.node(t, {
|
|
1742
1816
|
kind: c.SCHEMA_EXTENSION,
|
|
1743
1817
|
directives: n,
|
|
1744
|
-
operationTypes:
|
|
1818
|
+
operationTypes: r
|
|
1745
1819
|
});
|
|
1746
1820
|
}
|
|
1747
1821
|
parseScalarTypeExtension() {
|
|
1748
1822
|
let t = this._lexer.token;
|
|
1749
1823
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1750
|
-
let n = this.parseName(),
|
|
1751
|
-
if (
|
|
1824
|
+
let n = this.parseName(), r = this.parseConstDirectives();
|
|
1825
|
+
if (r === void 0) throw this.unexpected();
|
|
1752
1826
|
return this.node(t, {
|
|
1753
1827
|
kind: c.SCALAR_TYPE_EXTENSION,
|
|
1754
1828
|
name: n,
|
|
1755
|
-
directives:
|
|
1829
|
+
directives: r
|
|
1756
1830
|
});
|
|
1757
1831
|
}
|
|
1758
1832
|
parseObjectTypeExtension() {
|
|
1759
1833
|
let t = this._lexer.token;
|
|
1760
1834
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1761
|
-
let n = this.parseName(),
|
|
1762
|
-
if (
|
|
1835
|
+
let n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1836
|
+
if (r === void 0 && i === void 0 && s === void 0) throw this.unexpected();
|
|
1763
1837
|
return this.node(t, {
|
|
1764
1838
|
kind: c.OBJECT_TYPE_EXTENSION,
|
|
1765
1839
|
name: n,
|
|
1766
|
-
interfaces:
|
|
1767
|
-
directives:
|
|
1840
|
+
interfaces: r,
|
|
1841
|
+
directives: i,
|
|
1768
1842
|
fields: s
|
|
1769
1843
|
});
|
|
1770
1844
|
}
|
|
1771
1845
|
parseInterfaceTypeExtension() {
|
|
1772
1846
|
let t = this._lexer.token;
|
|
1773
1847
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1774
|
-
let n = this.parseName(),
|
|
1775
|
-
if (
|
|
1848
|
+
let n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1849
|
+
if (r === void 0 && i === void 0 && s === void 0) throw this.unexpected();
|
|
1776
1850
|
return this.node(t, {
|
|
1777
1851
|
kind: c.INTERFACE_TYPE_EXTENSION,
|
|
1778
1852
|
name: n,
|
|
1779
|
-
interfaces:
|
|
1780
|
-
directives:
|
|
1853
|
+
interfaces: r,
|
|
1854
|
+
directives: i,
|
|
1781
1855
|
fields: s
|
|
1782
1856
|
});
|
|
1783
1857
|
}
|
|
1784
1858
|
parseUnionTypeExtension() {
|
|
1785
1859
|
let t = this._lexer.token;
|
|
1786
1860
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1787
|
-
let n = this.parseName(),
|
|
1788
|
-
if (
|
|
1861
|
+
let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
|
|
1862
|
+
if (r === void 0 && i === void 0) throw this.unexpected();
|
|
1789
1863
|
return this.node(t, {
|
|
1790
1864
|
kind: c.UNION_TYPE_EXTENSION,
|
|
1791
1865
|
name: n,
|
|
1792
|
-
directives:
|
|
1793
|
-
types:
|
|
1866
|
+
directives: r,
|
|
1867
|
+
types: i
|
|
1794
1868
|
});
|
|
1795
1869
|
}
|
|
1796
1870
|
parseEnumTypeExtension() {
|
|
1797
1871
|
let t = this._lexer.token;
|
|
1798
1872
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1799
|
-
let n = this.parseName(),
|
|
1800
|
-
if (
|
|
1873
|
+
let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
|
|
1874
|
+
if (r === void 0 && i === void 0) throw this.unexpected();
|
|
1801
1875
|
return this.node(t, {
|
|
1802
1876
|
kind: c.ENUM_TYPE_EXTENSION,
|
|
1803
1877
|
name: n,
|
|
1804
|
-
directives:
|
|
1805
|
-
values:
|
|
1878
|
+
directives: r,
|
|
1879
|
+
values: i
|
|
1806
1880
|
});
|
|
1807
1881
|
}
|
|
1808
1882
|
parseInputObjectTypeExtension() {
|
|
1809
1883
|
let t = this._lexer.token;
|
|
1810
1884
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1811
|
-
let n = this.parseName(),
|
|
1812
|
-
if (
|
|
1885
|
+
let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
|
|
1886
|
+
if (r === void 0 && i === void 0) throw this.unexpected();
|
|
1813
1887
|
return this.node(t, {
|
|
1814
1888
|
kind: c.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1815
1889
|
name: n,
|
|
1816
|
-
directives:
|
|
1817
|
-
fields:
|
|
1890
|
+
directives: r,
|
|
1891
|
+
fields: i
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
parseDirectiveExtension() {
|
|
1895
|
+
let t = this._lexer.token;
|
|
1896
|
+
this.expectKeyword("extend"), this.expectKeyword("directive"), this.expectToken(o.AT);
|
|
1897
|
+
let n = this.parseName(), r = this.parseConstDirectives();
|
|
1898
|
+
if (r === void 0) throw this.unexpected();
|
|
1899
|
+
return this.node(t, {
|
|
1900
|
+
kind: c.DIRECTIVE_EXTENSION,
|
|
1901
|
+
name: n,
|
|
1902
|
+
directives: r
|
|
1818
1903
|
});
|
|
1819
1904
|
}
|
|
1820
1905
|
parseDirectiveDefinition() {
|
|
1821
1906
|
let t = this._lexer.token, n = this.parseDescription();
|
|
1822
1907
|
this.expectKeyword("directive"), this.expectToken(o.AT);
|
|
1823
|
-
let
|
|
1908
|
+
let r = this.parseName(), i = this.parseArgumentDefs(), s = this.parseConstDirectives(), a = this.expectOptionalKeyword("repeatable");
|
|
1824
1909
|
this.expectKeyword("on");
|
|
1825
|
-
let
|
|
1910
|
+
let p = this.parseDirectiveLocations();
|
|
1826
1911
|
return this.node(t, {
|
|
1827
1912
|
kind: c.DIRECTIVE_DEFINITION,
|
|
1828
1913
|
description: n,
|
|
1829
|
-
name:
|
|
1830
|
-
arguments:
|
|
1831
|
-
|
|
1832
|
-
|
|
1914
|
+
name: r,
|
|
1915
|
+
arguments: i,
|
|
1916
|
+
directives: s,
|
|
1917
|
+
repeatable: a,
|
|
1918
|
+
locations: p
|
|
1833
1919
|
});
|
|
1834
1920
|
}
|
|
1835
1921
|
parseDirectiveLocations() {
|
|
@@ -1837,36 +1923,36 @@ spurious results.`);
|
|
|
1837
1923
|
}
|
|
1838
1924
|
parseDirectiveLocation() {
|
|
1839
1925
|
let t = this._lexer.token, n = this.parseName();
|
|
1840
|
-
if (
|
|
1926
|
+
if (et(ye, n.value)) return n;
|
|
1841
1927
|
throw this.unexpected(t);
|
|
1842
1928
|
}
|
|
1843
1929
|
parseSchemaCoordinate() {
|
|
1844
|
-
let t = this._lexer.token, n = this.expectOptionalToken(o.AT),
|
|
1845
|
-
!n && this.expectOptionalToken(o.DOT) && (
|
|
1930
|
+
let t = this._lexer.token, n = this.expectOptionalToken(o.AT), r = this.parseName(), i;
|
|
1931
|
+
!n && this.expectOptionalToken(o.DOT) && (i = this.parseName());
|
|
1846
1932
|
let s;
|
|
1847
|
-
return (n ||
|
|
1933
|
+
return (n || i) && this.expectOptionalToken(o.PAREN_L) && (s = this.parseName(), this.expectToken(o.COLON), this.expectToken(o.PAREN_R)), n ? s ? this.node(t, {
|
|
1848
1934
|
kind: c.DIRECTIVE_ARGUMENT_COORDINATE,
|
|
1849
|
-
name:
|
|
1935
|
+
name: r,
|
|
1850
1936
|
argumentName: s
|
|
1851
1937
|
}) : this.node(t, {
|
|
1852
1938
|
kind: c.DIRECTIVE_COORDINATE,
|
|
1853
|
-
name:
|
|
1854
|
-
}) :
|
|
1939
|
+
name: r
|
|
1940
|
+
}) : i ? s ? this.node(t, {
|
|
1855
1941
|
kind: c.ARGUMENT_COORDINATE,
|
|
1856
|
-
name:
|
|
1857
|
-
fieldName:
|
|
1942
|
+
name: r,
|
|
1943
|
+
fieldName: i,
|
|
1858
1944
|
argumentName: s
|
|
1859
1945
|
}) : this.node(t, {
|
|
1860
1946
|
kind: c.MEMBER_COORDINATE,
|
|
1861
|
-
name:
|
|
1862
|
-
memberName:
|
|
1947
|
+
name: r,
|
|
1948
|
+
memberName: i
|
|
1863
1949
|
}) : this.node(t, {
|
|
1864
1950
|
kind: c.TYPE_COORDINATE,
|
|
1865
|
-
name:
|
|
1951
|
+
name: r
|
|
1866
1952
|
});
|
|
1867
1953
|
}
|
|
1868
1954
|
node(t, n) {
|
|
1869
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
1955
|
+
return this._options.noLocation !== !0 && (n.loc = new Y(t, this._lexer.lastToken, this._lexer.source)), n;
|
|
1870
1956
|
}
|
|
1871
1957
|
peek(t) {
|
|
1872
1958
|
return this._lexer.token.kind === t;
|
|
@@ -1874,7 +1960,7 @@ spurious results.`);
|
|
|
1874
1960
|
expectToken(t) {
|
|
1875
1961
|
let n = this._lexer.token;
|
|
1876
1962
|
if (n.kind === t) return this.advanceLexer(), n;
|
|
1877
|
-
throw
|
|
1963
|
+
throw f(this._lexer.source, n.start, `Expected ${ft(t)}, found ${se(n)}.`);
|
|
1878
1964
|
}
|
|
1879
1965
|
expectOptionalToken(t) {
|
|
1880
1966
|
return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
|
|
@@ -1882,7 +1968,7 @@ spurious results.`);
|
|
|
1882
1968
|
expectKeyword(t) {
|
|
1883
1969
|
let n = this._lexer.token;
|
|
1884
1970
|
if (n.kind === o.NAME && n.value === t) this.advanceLexer();
|
|
1885
|
-
else throw
|
|
1971
|
+
else throw f(this._lexer.source, n.start, `Expected "${t}", found ${se(n)}.`);
|
|
1886
1972
|
}
|
|
1887
1973
|
expectOptionalKeyword(t) {
|
|
1888
1974
|
let n = this._lexer.token;
|
|
@@ -1890,55 +1976,54 @@ spurious results.`);
|
|
|
1890
1976
|
}
|
|
1891
1977
|
unexpected(t) {
|
|
1892
1978
|
let n = t ?? this._lexer.token;
|
|
1893
|
-
return
|
|
1979
|
+
return f(this._lexer.source, n.start, `Unexpected ${se(n)}.`);
|
|
1894
1980
|
}
|
|
1895
|
-
any(t, n,
|
|
1981
|
+
any(t, n, r) {
|
|
1896
1982
|
this.expectToken(t);
|
|
1897
|
-
let
|
|
1898
|
-
for (; !this.expectOptionalToken(
|
|
1899
|
-
return
|
|
1983
|
+
let i = [];
|
|
1984
|
+
for (; !this.expectOptionalToken(r);) i.push(n.call(this));
|
|
1985
|
+
return i;
|
|
1900
1986
|
}
|
|
1901
|
-
optionalMany(t, n,
|
|
1987
|
+
optionalMany(t, n, r) {
|
|
1902
1988
|
if (this.expectOptionalToken(t)) {
|
|
1903
|
-
let
|
|
1989
|
+
let i = [];
|
|
1904
1990
|
do
|
|
1905
|
-
|
|
1906
|
-
while (!this.expectOptionalToken(
|
|
1907
|
-
return
|
|
1991
|
+
i.push(n.call(this));
|
|
1992
|
+
while (!this.expectOptionalToken(r));
|
|
1993
|
+
return i;
|
|
1908
1994
|
}
|
|
1909
|
-
return [];
|
|
1910
1995
|
}
|
|
1911
|
-
many(t, n,
|
|
1996
|
+
many(t, n, r) {
|
|
1912
1997
|
this.expectToken(t);
|
|
1913
|
-
let
|
|
1998
|
+
let i = [];
|
|
1914
1999
|
do
|
|
1915
|
-
|
|
1916
|
-
while (!this.expectOptionalToken(
|
|
1917
|
-
return
|
|
2000
|
+
i.push(n.call(this));
|
|
2001
|
+
while (!this.expectOptionalToken(r));
|
|
2002
|
+
return i;
|
|
1918
2003
|
}
|
|
1919
2004
|
delimitedMany(t, n) {
|
|
1920
2005
|
this.expectOptionalToken(t);
|
|
1921
|
-
let
|
|
2006
|
+
let r = [];
|
|
1922
2007
|
do
|
|
1923
|
-
|
|
2008
|
+
r.push(n.call(this));
|
|
1924
2009
|
while (this.expectOptionalToken(t));
|
|
1925
|
-
return
|
|
2010
|
+
return r;
|
|
1926
2011
|
}
|
|
1927
2012
|
advanceLexer() {
|
|
1928
2013
|
let { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
1929
|
-
if (n.kind !== o.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t)) throw
|
|
2014
|
+
if (n.kind !== o.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t)) throw f(this._lexer.source, n.start, `Document contains more than ${t} tokens. Parsing aborted.`);
|
|
1930
2015
|
}
|
|
1931
2016
|
};
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
parse:
|
|
2017
|
+
mt = ei;
|
|
2018
|
+
ni = { experimentalFragmentArguments: !0 };
|
|
2019
|
+
si = {
|
|
2020
|
+
parse: ri,
|
|
1936
2021
|
astFormat: "graphql",
|
|
1937
|
-
hasPragma:
|
|
1938
|
-
hasIgnorePragma:
|
|
1939
|
-
locStart:
|
|
1940
|
-
locEnd:
|
|
2022
|
+
hasPragma: Ue,
|
|
2023
|
+
hasIgnorePragma: Be,
|
|
2024
|
+
locStart: ee,
|
|
2025
|
+
locEnd: te
|
|
1941
2026
|
};
|
|
1942
|
-
|
|
2027
|
+
oi = { graphql: qe };
|
|
1943
2028
|
}))();
|
|
1944
|
-
export {
|
|
2029
|
+
export { ht as default, Qe as languages, Xe as options, _e as parsers, oi as printers };
|