stepzen-graphiql 2.1.1 → 2.1.3-experimental.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/README.md +5 -0
- package/dist/babel-D4jPkB8I.js +15 -0
- package/dist/babel-JpECBl9w.mjs +7255 -0
- package/dist/components/ExplorerPage/ExplorerPage.d.ts +1 -1
- package/dist/components/ExplorerPage/GraphiQLInterface.d.ts +15 -6
- package/dist/components/ExplorerPage/Snippets.d.ts +0 -2
- package/dist/components/ExplorerPage/clearResponse.d.ts +1 -1
- package/dist/components/ExplorerPage/clearTooltip.d.ts +1 -1
- package/dist/estree-C0Hb5Q7V.mjs +4528 -0
- package/dist/estree-U7n5DgHH.js +44 -0
- package/dist/graphql-BTSjQZiC.js +28 -0
- package/dist/graphql-CBsByfto.js +28 -0
- package/dist/graphql-DDJE6tIl.mjs +157 -0
- package/dist/graphql-DrfUc9jr.mjs +1256 -0
- package/dist/graphql-DrfV554J.js +6 -0
- package/dist/graphql-QzAQRYwl.mjs +1221 -0
- package/dist/graphqlMode-DN1ezrYh.js +1 -0
- package/dist/graphqlMode-vV8mnLBW.mjs +262 -0
- package/dist/index-CjC6wsAG.js +1 -0
- package/dist/index-RniHQi68.mjs +84805 -0
- package/dist/index-gvW0eRXD.js +687 -0
- package/dist/index-tHknWeFg.mjs +295 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/jsonMode-BW-tqoSY.js +15 -0
- package/dist/jsonMode-Cj0cONq6.mjs +2002 -0
- package/dist/lib/graphiql-helpers.d.ts +2 -2
- package/dist/lite-Dpvo4tIS.js +1 -0
- package/dist/lite-hj39DC-n.mjs +135 -0
- package/dist/monaco-editor-C-pj7hSk.mjs +17 -0
- package/dist/monaco-editor-CBZFMjO6.js +1 -0
- package/dist/mouseTarget-C-J1vBNL.mjs +9353 -0
- package/dist/mouseTarget-S3azYj9_.js +9 -0
- package/dist/standalone-BhI0QomE.mjs +2458 -0
- package/dist/standalone-YWSF5RH2.js +29 -0
- package/dist/style.css +2 -2
- package/dist/style2.css +1 -0
- package/dist/toggleHighContrast-BK2acAo4.mjs +97805 -0
- package/dist/toggleHighContrast-MyO5wNxT.js +726 -0
- package/package.json +13 -15
- package/dist/Range-CPFFy5pj.mjs +0 -26
- package/dist/Range-CUfOrqgY.js +0 -1
- package/dist/SchemaReference-DNGK8Gti.mjs +0 -146
- package/dist/SchemaReference-PZPPI4-g.js +0 -1
- package/dist/brace-fold-DFRMFuzG.mjs +0 -122
- package/dist/brace-fold-QYFeMqi4.js +0 -1
- package/dist/closebrackets-5W81jIxx.js +0 -2
- package/dist/closebrackets-BJdKNrct.mjs +0 -165
- package/dist/codemirror-CK47QajN.mjs +0 -27
- package/dist/codemirror-DMBo1i5w.js +0 -24
- package/dist/codemirror-DgPcZxSc.mjs +0 -6121
- package/dist/codemirror-P5arRD-4.js +0 -1
- package/dist/comment-DZX4WUX2.js +0 -2
- package/dist/comment-DaZ9yeFw.mjs +0 -150
- package/dist/dialog-BWHlvTdM.js +0 -1
- package/dist/dialog-BvB91RPq.mjs +0 -26
- package/dist/dialog-Ci1bnuc2.mjs +0 -74
- package/dist/dialog-Dh2DOTOu.js +0 -1
- package/dist/foldgutter-CEPGXQXV.mjs +0 -238
- package/dist/foldgutter-lfb5vdue.js +0 -1
- package/dist/forEachState-DA54msa8.mjs +0 -11
- package/dist/forEachState-DY_pA9Bd.js +0 -1
- package/dist/hint-BImUj9vL.mjs +0 -24
- package/dist/hint-BYh7bCzG.js +0 -1
- package/dist/hint-CeNacopx.mjs +0 -123
- package/dist/hint-Cqs-Eq99.js +0 -1
- package/dist/index-BXTilrNr.mjs +0 -11
- package/dist/index-BqePscbb.js +0 -1
- package/dist/index-Of0v8HXf.js +0 -650
- package/dist/index-c_h-B3RW.mjs +0 -89430
- package/dist/info-DKGfeFeR.mjs +0 -99
- package/dist/info-addon-0QldEyjg.js +0 -1
- package/dist/info-addon-BQBJGmtN.mjs +0 -66
- package/dist/info-euxfaXDv.js +0 -1
- package/dist/javascript-BMRweX7z.js +0 -1
- package/dist/javascript-CEIhlHWT.mjs +0 -26
- package/dist/javascript-RO_jaPiE.mjs +0 -707
- package/dist/javascript-poxRzxcy.js +0 -1
- package/dist/jsx-BY-uBax7.js +0 -1
- package/dist/jsx-CZtHOvZL.mjs +0 -414
- package/dist/jump-Bn-VPPJQ.js +0 -1
- package/dist/jump-BrK8-pOa.mjs +0 -85
- package/dist/jump-to-line-V4vHDeSQ.mjs +0 -61
- package/dist/jump-to-line-Zpc7tkYy.js +0 -1
- package/dist/lint-BBDtrEaL.js +0 -1
- package/dist/lint-BEn4QK3F.mjs +0 -216
- package/dist/lint-BgrfL8k7.js +0 -1
- package/dist/lint-CiQwkfWf.mjs +0 -112
- package/dist/lint-DxY_4HRh.js +0 -6
- package/dist/lint-naD3ldhf.mjs +0 -272
- package/dist/matchbrackets-BB4g2Y6d.mjs +0 -87
- package/dist/matchbrackets-DPv_MB7c.js +0 -1
- package/dist/matchbrackets-DhN7zJoS.js +0 -1
- package/dist/matchbrackets-eKECiv9B.mjs +0 -26
- package/dist/mode-CgGO246j.js +0 -1
- package/dist/mode-CwlRWrPi.mjs +0 -73
- package/dist/mode-DyP1DXNa.js +0 -1
- package/dist/mode-indent-9VnFlqY-.mjs +0 -8
- package/dist/mode-indent-m3TP74Ia.js +0 -1
- package/dist/mode-kdpxZ9Hq.mjs +0 -25
- package/dist/mode-r_2HfIrS.js +0 -1
- package/dist/mode-xgi1fEzL.mjs +0 -64
- package/dist/search-BuLFIkN5.mjs +0 -268
- package/dist/search-CclAH4eV.js +0 -2
- package/dist/searchcursor-B9F32jvl.mjs +0 -26
- package/dist/searchcursor-CV26OekK.js +0 -1
- package/dist/searchcursor-DHtNMOPb.mjs +0 -239
- package/dist/searchcursor-eGwb3e2h.js +0 -7
- package/dist/show-hint-BfWoiGzQ.mjs +0 -357
- package/dist/show-hint-CQ_VjC6w.js +0 -1
- package/dist/sublime-C6Rg9CL1.mjs +0 -563
- package/dist/sublime-DFk-sDtd.js +0 -6
|
@@ -0,0 +1,1256 @@
|
|
|
1
|
+
var En = Object.defineProperty;
|
|
2
|
+
var mn = (A, x, I) => x in A ? En(A, x, { enumerable: !0, configurable: !0, writable: !0, value: I }) : A[x] = I;
|
|
3
|
+
var xe = (A, x, I) => mn(A, typeof x != "symbol" ? x + "" : x, I);
|
|
4
|
+
import { l as Tn } from "./index-RniHQi68.mjs";
|
|
5
|
+
function Nn(A, x) {
|
|
6
|
+
for (var I = 0; I < x.length; I++) {
|
|
7
|
+
const S = x[I];
|
|
8
|
+
if (typeof S != "string" && !Array.isArray(S)) {
|
|
9
|
+
for (const g in S)
|
|
10
|
+
if (g !== "default" && !(g in A)) {
|
|
11
|
+
const M = Object.getOwnPropertyDescriptor(S, g);
|
|
12
|
+
M && Object.defineProperty(A, g, M.get ? M : {
|
|
13
|
+
enumerable: !0,
|
|
14
|
+
get: () => S[g]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return Object.freeze(Object.defineProperty(A, Symbol.toStringTag, { value: "Module" }));
|
|
20
|
+
}
|
|
21
|
+
var Z = { exports: {} }, _e;
|
|
22
|
+
function In() {
|
|
23
|
+
return _e || (_e = 1, (function(A, x) {
|
|
24
|
+
(function(I) {
|
|
25
|
+
function S() {
|
|
26
|
+
var g = I();
|
|
27
|
+
return g.default || g;
|
|
28
|
+
}
|
|
29
|
+
A.exports = S();
|
|
30
|
+
})(function() {
|
|
31
|
+
var I = Object.defineProperty, S = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyNames, M = Object.prototype.hasOwnProperty, ee = (e, t) => {
|
|
32
|
+
for (var n in t) I(e, n, { get: t[n], enumerable: !0 });
|
|
33
|
+
}, Ce = (e, t, n, i) => {
|
|
34
|
+
if (t && typeof t == "object" || typeof t == "function") for (let r of g(t)) !M.call(e, r) && r !== n && I(e, r, { get: () => t[r], enumerable: !(i = S(t, r)) || i.enumerable });
|
|
35
|
+
return e;
|
|
36
|
+
}, Se = (e) => Ce(I({}, "__esModule", { value: !0 }), e), te = {};
|
|
37
|
+
ee(te, { languages: () => xt, options: () => kt, parsers: () => de, printers: () => fn });
|
|
38
|
+
var be = (e, t) => (n, i, ...r) => n | 1 && i == null ? void 0 : (t.call(i) ?? i[e]).apply(i, r), Re = String.prototype.replaceAll ?? function(e, t) {
|
|
39
|
+
return e.global ? this.replace(e, t) : this.split(e).join(t);
|
|
40
|
+
}, Le = be("replaceAll", function() {
|
|
41
|
+
if (typeof this == "string") return Re;
|
|
42
|
+
}), Y = Le, Fe = () => {
|
|
43
|
+
}, we = Fe, Pe = "indent", Me = "group", Ue = "if-break", q = "line", Ve = "break-parent", Be = we;
|
|
44
|
+
function v(e) {
|
|
45
|
+
return { type: Pe, contents: e };
|
|
46
|
+
}
|
|
47
|
+
var je = { type: Ve };
|
|
48
|
+
function O(e, t = {}) {
|
|
49
|
+
return Be(t.expandedStates), { type: Me, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
|
|
50
|
+
}
|
|
51
|
+
function k(e, t = "", n = {}) {
|
|
52
|
+
return { type: Ue, breakContents: e, flatContents: t, groupId: n.groupId };
|
|
53
|
+
}
|
|
54
|
+
function m(e, t) {
|
|
55
|
+
let n = [];
|
|
56
|
+
for (let i = 0; i < t.length; i++) i !== 0 && n.push(e), n.push(t[i]);
|
|
57
|
+
return n;
|
|
58
|
+
}
|
|
59
|
+
var R = { type: q }, u = { type: q, soft: !0 }, $e = { type: q, hard: !0 }, h = [$e, je];
|
|
60
|
+
function J(e) {
|
|
61
|
+
return (t, n, i) => {
|
|
62
|
+
let r = !!(i != null && i.backwards);
|
|
63
|
+
if (n === !1) return !1;
|
|
64
|
+
let { length: s } = t, l = n;
|
|
65
|
+
for (; l >= 0 && l < s; ) {
|
|
66
|
+
let c = t.charAt(l);
|
|
67
|
+
if (e instanceof RegExp) {
|
|
68
|
+
if (!e.test(c)) return l;
|
|
69
|
+
} else if (!e.includes(c)) return l;
|
|
70
|
+
r ? l-- : l++;
|
|
71
|
+
}
|
|
72
|
+
return l === -1 || l === s ? l : !1;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
var ne = J(" "), Ke = J(",; "), Ge = J(/[^\n\r]/u), ie = (e) => e === `
|
|
76
|
+
` || e === "\r" || e === "\u2028" || e === "\u2029";
|
|
77
|
+
function Ye(e, t, n) {
|
|
78
|
+
let i = !!(n != null && n.backwards);
|
|
79
|
+
if (t === !1) return !1;
|
|
80
|
+
let r = e.charAt(t);
|
|
81
|
+
if (i) {
|
|
82
|
+
if (e.charAt(t - 1) === "\r" && r === `
|
|
83
|
+
`) return t - 2;
|
|
84
|
+
if (ie(r)) return t - 1;
|
|
85
|
+
} else {
|
|
86
|
+
if (r === "\r" && e.charAt(t + 1) === `
|
|
87
|
+
`) return t + 2;
|
|
88
|
+
if (ie(r)) return t + 1;
|
|
89
|
+
}
|
|
90
|
+
return t;
|
|
91
|
+
}
|
|
92
|
+
var re = Ye;
|
|
93
|
+
function qe(e, t, n = {}) {
|
|
94
|
+
let i = ne(e, n.backwards ? t - 1 : t, n), r = re(e, i, n);
|
|
95
|
+
return i !== r;
|
|
96
|
+
}
|
|
97
|
+
var Je = qe;
|
|
98
|
+
function Qe(e, t) {
|
|
99
|
+
if (t === !1) return !1;
|
|
100
|
+
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
101
|
+
for (let n = t + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
|
|
102
|
+
}
|
|
103
|
+
return t;
|
|
104
|
+
}
|
|
105
|
+
var Xe = Qe;
|
|
106
|
+
function ze(e, t) {
|
|
107
|
+
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? Ge(e, t) : t;
|
|
108
|
+
}
|
|
109
|
+
var He = ze;
|
|
110
|
+
function We(e, t) {
|
|
111
|
+
let n = null, i = t;
|
|
112
|
+
for (; i !== n; ) n = i, i = Ke(e, i), i = Xe(e, i), i = ne(e, i);
|
|
113
|
+
return i = He(e, i), i = re(e, i), i !== !1 && Je(e, i);
|
|
114
|
+
}
|
|
115
|
+
var Ze = We;
|
|
116
|
+
function et(e) {
|
|
117
|
+
return Array.isArray(e) && e.length > 0;
|
|
118
|
+
}
|
|
119
|
+
var se = et, tt = class extends Error {
|
|
120
|
+
constructor(t, n, i = "type") {
|
|
121
|
+
super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`);
|
|
122
|
+
xe(this, "name", "UnexpectedNodeError");
|
|
123
|
+
this.node = t;
|
|
124
|
+
}
|
|
125
|
+
}, nt = tt, U = null;
|
|
126
|
+
function V(e) {
|
|
127
|
+
if (U !== null && typeof U.property) {
|
|
128
|
+
let t = U;
|
|
129
|
+
return U = V.prototype = null, t;
|
|
130
|
+
}
|
|
131
|
+
return U = V.prototype = e ?? /* @__PURE__ */ Object.create(null), new V();
|
|
132
|
+
}
|
|
133
|
+
var it = 10;
|
|
134
|
+
for (let e = 0; e <= it; e++) V();
|
|
135
|
+
function rt(e) {
|
|
136
|
+
return V(e);
|
|
137
|
+
}
|
|
138
|
+
function st(e, t = "type") {
|
|
139
|
+
rt(e);
|
|
140
|
+
function n(i) {
|
|
141
|
+
let r = i[t], s = e[r];
|
|
142
|
+
if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${r}'.`), { node: i });
|
|
143
|
+
return s;
|
|
144
|
+
}
|
|
145
|
+
return n;
|
|
146
|
+
}
|
|
147
|
+
var at = st, ot = class {
|
|
148
|
+
constructor(e, t, n) {
|
|
149
|
+
this.start = e.start, this.end = t.end, this.startToken = e, this.endToken = t, this.source = n;
|
|
150
|
+
}
|
|
151
|
+
get [Symbol.toStringTag]() {
|
|
152
|
+
return "Location";
|
|
153
|
+
}
|
|
154
|
+
toJSON() {
|
|
155
|
+
return { start: this.start, end: this.end };
|
|
156
|
+
}
|
|
157
|
+
}, ae = class {
|
|
158
|
+
constructor(e, t, n, i, r, s) {
|
|
159
|
+
this.kind = e, this.start = t, this.end = n, this.line = i, this.column = r, this.value = s, this.prev = null, this.next = null;
|
|
160
|
+
}
|
|
161
|
+
get [Symbol.toStringTag]() {
|
|
162
|
+
return "Token";
|
|
163
|
+
}
|
|
164
|
+
toJSON() {
|
|
165
|
+
return { kind: this.kind, value: this.value, line: this.line, column: this.column };
|
|
166
|
+
}
|
|
167
|
+
}, oe = { Name: [], Document: ["definitions"], OperationDefinition: ["description", "name", "variableDefinitions", "directives", "selectionSet"], VariableDefinition: ["description", "variable", "type", "defaultValue", "directives"], Variable: ["name"], SelectionSet: ["selections"], Field: ["alias", "name", "arguments", "directives", "selectionSet"], Argument: ["name", "value"], FragmentSpread: ["name", "directives"], InlineFragment: ["typeCondition", "directives", "selectionSet"], FragmentDefinition: ["description", "name", "variableDefinitions", "typeCondition", "directives", "selectionSet"], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ["values"], ObjectValue: ["fields"], ObjectField: ["name", "value"], Directive: ["name", "arguments"], NamedType: ["name"], ListType: ["type"], NonNullType: ["type"], SchemaDefinition: ["description", "directives", "operationTypes"], OperationTypeDefinition: ["type"], ScalarTypeDefinition: ["description", "name", "directives"], ObjectTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], FieldDefinition: ["description", "name", "arguments", "type", "directives"], InputValueDefinition: ["description", "name", "type", "defaultValue", "directives"], InterfaceTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], UnionTypeDefinition: ["description", "name", "directives", "types"], EnumTypeDefinition: ["description", "name", "directives", "values"], EnumValueDefinition: ["description", "name", "directives"], InputObjectTypeDefinition: ["description", "name", "directives", "fields"], DirectiveDefinition: ["description", "name", "arguments", "locations"], SchemaExtension: ["directives", "operationTypes"], ScalarTypeExtension: ["name", "directives"], ObjectTypeExtension: ["name", "interfaces", "directives", "fields"], InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"], UnionTypeExtension: ["name", "directives", "types"], EnumTypeExtension: ["name", "directives", "values"], InputObjectTypeExtension: ["name", "directives", "fields"], TypeCoordinate: ["name"], MemberCoordinate: ["name", "memberName"], ArgumentCoordinate: ["name", "fieldName", "argumentName"], DirectiveCoordinate: ["name"], DirectiveArgumentCoordinate: ["name", "argumentName"] };
|
|
168
|
+
new Set(Object.keys(oe));
|
|
169
|
+
var L;
|
|
170
|
+
(function(e) {
|
|
171
|
+
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
172
|
+
})(L || (L = {}));
|
|
173
|
+
var le = { ...oe };
|
|
174
|
+
for (let e of ["ArgumentCoordinate", "DirectiveArgumentCoordinate", "DirectiveCoordinate", "MemberCoordinate", "TypeCoordinate"]) delete le[e];
|
|
175
|
+
var lt = le, ct = at(lt, "kind"), ut = ct, ce = (e) => e.loc.start, ue = (e) => e.loc.end, pt = "format", ht = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, dt = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u, ft = (e) => dt.test(e), Et = (e) => ht.test(e), mt = (e) => `# @${pt}
|
|
176
|
+
|
|
177
|
+
${e}`;
|
|
178
|
+
function Tt(e, t, n) {
|
|
179
|
+
let { node: i } = e;
|
|
180
|
+
if (!i.description) return "";
|
|
181
|
+
let r = [n("description")];
|
|
182
|
+
return i.kind === "InputValueDefinition" && !i.description.block ? r.push(R) : r.push(h), r;
|
|
183
|
+
}
|
|
184
|
+
var D = Tt;
|
|
185
|
+
function Nt(e, t, n) {
|
|
186
|
+
let { node: i } = e;
|
|
187
|
+
switch (i.kind) {
|
|
188
|
+
case "Document":
|
|
189
|
+
return [...m(h, C(e, t, n, "definitions")), h];
|
|
190
|
+
case "OperationDefinition": {
|
|
191
|
+
let r = t.originalText[ce(i)] !== "{", s = !!i.name;
|
|
192
|
+
return [D(e, t, n), r ? i.operation : "", r && s ? [" ", n("name")] : "", r && !s && se(i.variableDefinitions) ? " " : "", pe(e, n), T(e, n, i), !r && !s ? "" : " ", n("selectionSet")];
|
|
193
|
+
}
|
|
194
|
+
case "FragmentDefinition":
|
|
195
|
+
return [D(e, t, n), "fragment ", n("name"), pe(e, n), " on ", n("typeCondition"), T(e, n, i), " ", n("selectionSet")];
|
|
196
|
+
case "SelectionSet":
|
|
197
|
+
return ["{", v([h, m(h, C(e, t, n, "selections"))]), h, "}"];
|
|
198
|
+
case "Field":
|
|
199
|
+
return O([i.alias ? [n("alias"), ": "] : "", n("name"), i.arguments.length > 0 ? O(["(", v([u, m([k("", ", "), u], C(e, t, n, "arguments"))]), u, ")"]) : "", T(e, n, i), i.selectionSet ? " " : "", n("selectionSet")]);
|
|
200
|
+
case "Name":
|
|
201
|
+
return i.value;
|
|
202
|
+
case "StringValue":
|
|
203
|
+
if (i.block) {
|
|
204
|
+
let r = Y(0, i.value, '"""', '\\"""').split(`
|
|
205
|
+
`);
|
|
206
|
+
return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), m(h, ['"""', ...r, '"""']);
|
|
207
|
+
}
|
|
208
|
+
return ['"', Y(0, Y(0, i.value, /["\\]/gu, "\\$&"), `
|
|
209
|
+
`, "\\n"), '"'];
|
|
210
|
+
case "IntValue":
|
|
211
|
+
case "FloatValue":
|
|
212
|
+
case "EnumValue":
|
|
213
|
+
return i.value;
|
|
214
|
+
case "BooleanValue":
|
|
215
|
+
return i.value ? "true" : "false";
|
|
216
|
+
case "NullValue":
|
|
217
|
+
return "null";
|
|
218
|
+
case "Variable":
|
|
219
|
+
return ["$", n("name")];
|
|
220
|
+
case "ListValue":
|
|
221
|
+
return O(["[", v([u, m([k("", ", "), u], e.map(n, "values"))]), u, "]"]);
|
|
222
|
+
case "ObjectValue": {
|
|
223
|
+
let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
|
|
224
|
+
return O(["{", r, v([u, m([k("", ", "), u], e.map(n, "fields"))]), u, k("", r), "}"]);
|
|
225
|
+
}
|
|
226
|
+
case "ObjectField":
|
|
227
|
+
case "Argument":
|
|
228
|
+
return [n("name"), ": ", n("value")];
|
|
229
|
+
case "Directive":
|
|
230
|
+
return ["@", n("name"), i.arguments.length > 0 ? O(["(", v([u, m([k("", ", "), u], C(e, t, n, "arguments"))]), u, ")"]) : ""];
|
|
231
|
+
case "NamedType":
|
|
232
|
+
return n("name");
|
|
233
|
+
case "VariableDefinition":
|
|
234
|
+
return [D(e, t, n), n("variable"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", T(e, n, i)];
|
|
235
|
+
case "ObjectTypeExtension":
|
|
236
|
+
case "ObjectTypeDefinition":
|
|
237
|
+
case "InputObjectTypeExtension":
|
|
238
|
+
case "InputObjectTypeDefinition":
|
|
239
|
+
case "InterfaceTypeExtension":
|
|
240
|
+
case "InterfaceTypeDefinition": {
|
|
241
|
+
let { kind: r } = i, s = [];
|
|
242
|
+
return r.endsWith("TypeDefinition") ? s.push(D(e, t, n)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !r.startsWith("InputObjectType") && i.interfaces.length > 0 && s.push(" implements ", ...yt(e, t, n)), s.push(T(e, n, i)), i.fields.length > 0 && s.push([" {", v([h, m(h, C(e, t, n, "fields"))]), h, "}"]), s;
|
|
243
|
+
}
|
|
244
|
+
case "FieldDefinition":
|
|
245
|
+
return [D(e, t, n), n("name"), i.arguments.length > 0 ? O(["(", v([u, m([k("", ", "), u], C(e, t, n, "arguments"))]), u, ")"]) : "", ": ", n("type"), T(e, n, i)];
|
|
246
|
+
case "DirectiveDefinition":
|
|
247
|
+
return [D(e, t, n), "directive ", "@", n("name"), i.arguments.length > 0 ? O(["(", v([u, m([k("", ", "), u], C(e, t, n, "arguments"))]), u, ")"]) : "", i.repeatable ? " repeatable" : "", " on ", ...m(" | ", e.map(n, "locations"))];
|
|
248
|
+
case "EnumTypeExtension":
|
|
249
|
+
case "EnumTypeDefinition":
|
|
250
|
+
return [D(e, t, n), i.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), T(e, n, i), i.values.length > 0 ? [" {", v([h, m(h, C(e, t, n, "values"))]), h, "}"] : ""];
|
|
251
|
+
case "EnumValueDefinition":
|
|
252
|
+
return [D(e, t, n), n("name"), T(e, n, i)];
|
|
253
|
+
case "InputValueDefinition":
|
|
254
|
+
return [D(e, t, n), n("name"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", T(e, n, i)];
|
|
255
|
+
case "SchemaExtension":
|
|
256
|
+
return ["extend schema", T(e, n, i), ...i.operationTypes.length > 0 ? [" {", v([h, m(h, C(e, t, n, "operationTypes"))]), h, "}"] : []];
|
|
257
|
+
case "SchemaDefinition":
|
|
258
|
+
return [D(e, t, n), "schema", T(e, n, i), " {", i.operationTypes.length > 0 ? v([h, m(h, C(e, t, n, "operationTypes"))]) : "", h, "}"];
|
|
259
|
+
case "OperationTypeDefinition":
|
|
260
|
+
return [i.operation, ": ", n("type")];
|
|
261
|
+
case "FragmentSpread":
|
|
262
|
+
return ["...", n("name"), T(e, n, i)];
|
|
263
|
+
case "InlineFragment":
|
|
264
|
+
return ["...", i.typeCondition ? [" on ", n("typeCondition")] : "", T(e, n, i), " ", n("selectionSet")];
|
|
265
|
+
case "UnionTypeExtension":
|
|
266
|
+
case "UnionTypeDefinition":
|
|
267
|
+
return O([D(e, t, n), O([i.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), T(e, n, i), i.types.length > 0 ? [" =", k("", " "), v([k([R, "| "]), m([R, "| "], e.map(n, "types"))])] : ""])]);
|
|
268
|
+
case "ScalarTypeExtension":
|
|
269
|
+
case "ScalarTypeDefinition":
|
|
270
|
+
return [D(e, t, n), i.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), T(e, n, i)];
|
|
271
|
+
case "NonNullType":
|
|
272
|
+
return [n("type"), "!"];
|
|
273
|
+
case "ListType":
|
|
274
|
+
return ["[", n("type"), "]"];
|
|
275
|
+
default:
|
|
276
|
+
throw new nt(i, "Graphql", "kind");
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function T(e, t, n) {
|
|
280
|
+
if (n.directives.length === 0) return "";
|
|
281
|
+
let i = m(R, e.map(t, "directives"));
|
|
282
|
+
return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? O([R, i]) : [" ", O(v([u, i]))];
|
|
283
|
+
}
|
|
284
|
+
function C(e, t, n, i) {
|
|
285
|
+
return e.map(({ isLast: r, node: s }) => {
|
|
286
|
+
let l = n();
|
|
287
|
+
return !r && Ze(t.originalText, ue(s)) ? [l, h] : l;
|
|
288
|
+
}, i);
|
|
289
|
+
}
|
|
290
|
+
function It(e) {
|
|
291
|
+
return e.kind !== "Comment";
|
|
292
|
+
}
|
|
293
|
+
function vt({ node: e }) {
|
|
294
|
+
if (e.kind === "Comment") return "#" + e.value.trimEnd();
|
|
295
|
+
throw new Error("Not a comment: " + JSON.stringify(e));
|
|
296
|
+
}
|
|
297
|
+
function yt(e, t, n) {
|
|
298
|
+
let { node: i } = e, r = [], { interfaces: s } = i, l = e.map(n, "interfaces");
|
|
299
|
+
for (let c = 0; c < s.length; c++) {
|
|
300
|
+
let p = s[c];
|
|
301
|
+
r.push(l[c]);
|
|
302
|
+
let y = s[c + 1];
|
|
303
|
+
if (y) {
|
|
304
|
+
let E = t.originalText.slice(p.loc.end, y.loc.start).includes("#");
|
|
305
|
+
r.push(" &", E ? R : " ");
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return r;
|
|
309
|
+
}
|
|
310
|
+
function pe(e, t) {
|
|
311
|
+
let { node: n } = e;
|
|
312
|
+
return se(n.variableDefinitions) ? O(["(", v([u, m([k("", ", "), u], e.map(t, "variableDefinitions"))]), u, ")"]) : "";
|
|
313
|
+
}
|
|
314
|
+
function he(e, t) {
|
|
315
|
+
e.kind === "StringValue" && e.block && !e.value.includes(`
|
|
316
|
+
`) && (t.value = e.value.trim());
|
|
317
|
+
}
|
|
318
|
+
he.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
|
|
319
|
+
function Ot(e) {
|
|
320
|
+
var n;
|
|
321
|
+
let { node: t } = e;
|
|
322
|
+
return (n = t == null ? void 0 : t.comments) == null ? void 0 : n.some((i) => i.value.trim() === "prettier-ignore");
|
|
323
|
+
}
|
|
324
|
+
var Dt = { print: Nt, massageAstNode: he, hasPrettierIgnore: Ot, insertPragma: mt, printComment: vt, canAttachComment: It, getVisitorKeys: ut }, At = Dt, xt = [{ name: "GraphQL", type: "data", aceMode: "graphqlschema", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", parsers: ["graphql"], vscodeLanguageIds: ["graphql"], linguistLanguageId: 139 }], _t = { bracketSpacing: { category: "Common", type: "boolean", default: !0, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." } }, gt = { bracketSpacing: _t.bracketSpacing }, kt = gt, de = {};
|
|
325
|
+
ee(de, { graphql: () => dn });
|
|
326
|
+
function Ct(e) {
|
|
327
|
+
return typeof e == "object" && e !== null;
|
|
328
|
+
}
|
|
329
|
+
function St(e, t) {
|
|
330
|
+
throw new Error("Unexpected invariant triggered.");
|
|
331
|
+
}
|
|
332
|
+
var bt = /\r\n|[\n\r]/g;
|
|
333
|
+
function Q(e, t) {
|
|
334
|
+
let n = 0, i = 1;
|
|
335
|
+
for (let r of e.body.matchAll(bt)) {
|
|
336
|
+
if (typeof r.index == "number" || St(), r.index >= t) break;
|
|
337
|
+
n = r.index + r[0].length, i += 1;
|
|
338
|
+
}
|
|
339
|
+
return { line: i, column: t + 1 - n };
|
|
340
|
+
}
|
|
341
|
+
function Rt(e) {
|
|
342
|
+
return fe(e.source, Q(e.source, e.start));
|
|
343
|
+
}
|
|
344
|
+
function fe(e, t) {
|
|
345
|
+
let n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, l = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, y = `${e.name}:${l}:${p}
|
|
346
|
+
`, E = i.split(/\r\n|[\n\r]/g), w = E[r];
|
|
347
|
+
if (w.length > 120) {
|
|
348
|
+
let _ = Math.floor(p / 80), W = p % 80, N = [];
|
|
349
|
+
for (let P = 0; P < w.length; P += 80) N.push(w.slice(P, P + 80));
|
|
350
|
+
return y + Ee([[`${l} |`, N[0]], ...N.slice(1, _ + 1).map((P) => ["|", P]), ["|", "^".padStart(W)], ["|", N[_ + 1]]]);
|
|
351
|
+
}
|
|
352
|
+
return y + Ee([[`${l - 1} |`, E[r - 1]], [`${l} |`, w], ["|", "^".padStart(p)], [`${l + 1} |`, E[r + 1]]]);
|
|
353
|
+
}
|
|
354
|
+
function Ee(e) {
|
|
355
|
+
let t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
|
|
356
|
+
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
357
|
+
`);
|
|
358
|
+
}
|
|
359
|
+
function Lt(e) {
|
|
360
|
+
let t = e[0];
|
|
361
|
+
return t == null || "kind" in t || "length" in t ? { nodes: t, source: e[1], positions: e[2], path: e[3], originalError: e[4], extensions: e[5] } : t;
|
|
362
|
+
}
|
|
363
|
+
var Ft = class ge extends Error {
|
|
364
|
+
constructor(t, ...n) {
|
|
365
|
+
var i, r, s;
|
|
366
|
+
let { nodes: l, source: c, positions: p, path: y, originalError: E, extensions: w } = Lt(n);
|
|
367
|
+
super(t), this.name = "GraphQLError", this.path = y ?? void 0, this.originalError = E ?? void 0, this.nodes = me(Array.isArray(l) ? l : l ? [l] : void 0);
|
|
368
|
+
let _ = me((i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null));
|
|
369
|
+
this.source = c ?? (_ == null || (r = _[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? (_ == null ? void 0 : _.map((N) => N.start)), this.locations = p && c ? p.map((N) => Q(c, N)) : _ == null ? void 0 : _.map((N) => Q(N.source, N.start));
|
|
370
|
+
let W = Ct(E == null ? void 0 : E.extensions) ? E == null ? void 0 : E.extensions : void 0;
|
|
371
|
+
this.extensions = (s = w ?? W) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: !0, enumerable: !0 }, name: { enumerable: !1 }, nodes: { enumerable: !1 }, source: { enumerable: !1 }, positions: { enumerable: !1 }, originalError: { enumerable: !1 } }), E != null && E.stack ? Object.defineProperty(this, "stack", { value: E.stack, writable: !0, configurable: !0 }) : Error.captureStackTrace ? Error.captureStackTrace(this, ge) : Object.defineProperty(this, "stack", { value: Error().stack, writable: !0, configurable: !0 });
|
|
372
|
+
}
|
|
373
|
+
get [Symbol.toStringTag]() {
|
|
374
|
+
return "GraphQLError";
|
|
375
|
+
}
|
|
376
|
+
toString() {
|
|
377
|
+
let t = this.message;
|
|
378
|
+
if (this.nodes) for (let n of this.nodes) n.loc && (t += `
|
|
379
|
+
|
|
380
|
+
` + Rt(n.loc));
|
|
381
|
+
else if (this.source && this.locations) for (let n of this.locations) t += `
|
|
382
|
+
|
|
383
|
+
` + fe(this.source, n);
|
|
384
|
+
return t;
|
|
385
|
+
}
|
|
386
|
+
toJSON() {
|
|
387
|
+
let t = { message: this.message };
|
|
388
|
+
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;
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
function me(e) {
|
|
392
|
+
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
393
|
+
}
|
|
394
|
+
function f(e, t, n) {
|
|
395
|
+
return new Ft(`Syntax Error: ${n}`, { source: e, positions: [t] });
|
|
396
|
+
}
|
|
397
|
+
var X;
|
|
398
|
+
(function(e) {
|
|
399
|
+
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
400
|
+
})(X || (X = {}));
|
|
401
|
+
var o;
|
|
402
|
+
(function(e) {
|
|
403
|
+
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
|
|
404
|
+
})(o || (o = {}));
|
|
405
|
+
function wt(e) {
|
|
406
|
+
return e === 9 || e === 32;
|
|
407
|
+
}
|
|
408
|
+
function B(e) {
|
|
409
|
+
return e >= 48 && e <= 57;
|
|
410
|
+
}
|
|
411
|
+
function Te(e) {
|
|
412
|
+
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
413
|
+
}
|
|
414
|
+
function Ne(e) {
|
|
415
|
+
return Te(e) || e === 95;
|
|
416
|
+
}
|
|
417
|
+
function Pt(e) {
|
|
418
|
+
return Te(e) || B(e) || e === 95;
|
|
419
|
+
}
|
|
420
|
+
function Mt(e) {
|
|
421
|
+
var t;
|
|
422
|
+
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
423
|
+
for (let l = 0; l < e.length; ++l) {
|
|
424
|
+
var s;
|
|
425
|
+
let c = e[l], p = Ut(c);
|
|
426
|
+
p !== c.length && (i = (s = i) !== null && s !== void 0 ? s : l, r = l, l !== 0 && p < n && (n = p));
|
|
427
|
+
}
|
|
428
|
+
return e.map((l, c) => c === 0 ? l : l.slice(n)).slice((t = i) !== null && t !== void 0 ? t : 0, r + 1);
|
|
429
|
+
}
|
|
430
|
+
function Ut(e) {
|
|
431
|
+
let t = 0;
|
|
432
|
+
for (; t < e.length && wt(e.charCodeAt(t)); ) ++t;
|
|
433
|
+
return t;
|
|
434
|
+
}
|
|
435
|
+
var a;
|
|
436
|
+
(function(e) {
|
|
437
|
+
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
438
|
+
})(a || (a = {}));
|
|
439
|
+
var Vt = class {
|
|
440
|
+
constructor(e) {
|
|
441
|
+
let t = new ae(a.SOF, 0, 0, 0, 0);
|
|
442
|
+
this.source = e, this.lastToken = t, this.token = t, this.line = 1, this.lineStart = 0;
|
|
443
|
+
}
|
|
444
|
+
get [Symbol.toStringTag]() {
|
|
445
|
+
return "Lexer";
|
|
446
|
+
}
|
|
447
|
+
advance() {
|
|
448
|
+
return this.lastToken = this.token, this.token = this.lookahead();
|
|
449
|
+
}
|
|
450
|
+
lookahead() {
|
|
451
|
+
let e = this.token;
|
|
452
|
+
if (e.kind !== a.EOF) do
|
|
453
|
+
if (e.next) e = e.next;
|
|
454
|
+
else {
|
|
455
|
+
let t = jt(this, e.end);
|
|
456
|
+
e.next = t, t.prev = e, e = t;
|
|
457
|
+
}
|
|
458
|
+
while (e.kind === a.COMMENT);
|
|
459
|
+
return e;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
function Bt(e) {
|
|
463
|
+
return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.DOT || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
|
|
464
|
+
}
|
|
465
|
+
function F(e) {
|
|
466
|
+
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
467
|
+
}
|
|
468
|
+
function $(e, t) {
|
|
469
|
+
return Ie(e.charCodeAt(t)) && ve(e.charCodeAt(t + 1));
|
|
470
|
+
}
|
|
471
|
+
function Ie(e) {
|
|
472
|
+
return e >= 55296 && e <= 56319;
|
|
473
|
+
}
|
|
474
|
+
function ve(e) {
|
|
475
|
+
return e >= 56320 && e <= 57343;
|
|
476
|
+
}
|
|
477
|
+
function b(e, t) {
|
|
478
|
+
let n = e.source.body.codePointAt(t);
|
|
479
|
+
if (n === void 0) return a.EOF;
|
|
480
|
+
if (n >= 32 && n <= 126) {
|
|
481
|
+
let i = String.fromCodePoint(n);
|
|
482
|
+
return i === '"' ? `'"'` : `"${i}"`;
|
|
483
|
+
}
|
|
484
|
+
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
485
|
+
}
|
|
486
|
+
function d(e, t, n, i, r) {
|
|
487
|
+
let s = e.line, l = 1 + n - e.lineStart;
|
|
488
|
+
return new ae(t, n, i, s, l, r);
|
|
489
|
+
}
|
|
490
|
+
function jt(e, t) {
|
|
491
|
+
let n = e.source.body, i = n.length, r = t;
|
|
492
|
+
for (; r < i; ) {
|
|
493
|
+
let s = n.charCodeAt(r);
|
|
494
|
+
switch (s) {
|
|
495
|
+
case 65279:
|
|
496
|
+
case 9:
|
|
497
|
+
case 32:
|
|
498
|
+
case 44:
|
|
499
|
+
++r;
|
|
500
|
+
continue;
|
|
501
|
+
case 10:
|
|
502
|
+
++r, ++e.line, e.lineStart = r;
|
|
503
|
+
continue;
|
|
504
|
+
case 13:
|
|
505
|
+
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
506
|
+
continue;
|
|
507
|
+
case 35:
|
|
508
|
+
return $t(e, r);
|
|
509
|
+
case 33:
|
|
510
|
+
return d(e, a.BANG, r, r + 1);
|
|
511
|
+
case 36:
|
|
512
|
+
return d(e, a.DOLLAR, r, r + 1);
|
|
513
|
+
case 38:
|
|
514
|
+
return d(e, a.AMP, r, r + 1);
|
|
515
|
+
case 40:
|
|
516
|
+
return d(e, a.PAREN_L, r, r + 1);
|
|
517
|
+
case 41:
|
|
518
|
+
return d(e, a.PAREN_R, r, r + 1);
|
|
519
|
+
case 46:
|
|
520
|
+
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46) return d(e, a.SPREAD, r, r + 3);
|
|
521
|
+
break;
|
|
522
|
+
case 58:
|
|
523
|
+
return d(e, a.COLON, r, r + 1);
|
|
524
|
+
case 61:
|
|
525
|
+
return d(e, a.EQUALS, r, r + 1);
|
|
526
|
+
case 64:
|
|
527
|
+
return d(e, a.AT, r, r + 1);
|
|
528
|
+
case 91:
|
|
529
|
+
return d(e, a.BRACKET_L, r, r + 1);
|
|
530
|
+
case 93:
|
|
531
|
+
return d(e, a.BRACKET_R, r, r + 1);
|
|
532
|
+
case 123:
|
|
533
|
+
return d(e, a.BRACE_L, r, r + 1);
|
|
534
|
+
case 124:
|
|
535
|
+
return d(e, a.PIPE, r, r + 1);
|
|
536
|
+
case 125:
|
|
537
|
+
return d(e, a.BRACE_R, r, r + 1);
|
|
538
|
+
case 34:
|
|
539
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Qt(e, r) : Gt(e, r);
|
|
540
|
+
}
|
|
541
|
+
if (B(s) || s === 45) return Kt(e, r, s);
|
|
542
|
+
if (Ne(s)) return Xt(e, r);
|
|
543
|
+
throw f(e.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : F(s) || $(n, r) ? `Unexpected character: ${b(e, r)}.` : `Invalid character: ${b(e, r)}.`);
|
|
544
|
+
}
|
|
545
|
+
return d(e, a.EOF, i, i);
|
|
546
|
+
}
|
|
547
|
+
function $t(e, t) {
|
|
548
|
+
let n = e.source.body, i = n.length, r = t + 1;
|
|
549
|
+
for (; r < i; ) {
|
|
550
|
+
let s = n.charCodeAt(r);
|
|
551
|
+
if (s === 10 || s === 13) break;
|
|
552
|
+
if (F(s)) ++r;
|
|
553
|
+
else if ($(n, r)) r += 2;
|
|
554
|
+
else break;
|
|
555
|
+
}
|
|
556
|
+
return d(e, a.COMMENT, t, r, n.slice(t + 1, r));
|
|
557
|
+
}
|
|
558
|
+
function Kt(e, t, n) {
|
|
559
|
+
let i = e.source.body, r = t, s = n, l = !1;
|
|
560
|
+
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
561
|
+
if (s = i.charCodeAt(++r), B(s)) throw f(e.source, r, `Invalid number, unexpected digit after 0: ${b(e, r)}.`);
|
|
562
|
+
} else r = z(e, r, s), s = i.charCodeAt(r);
|
|
563
|
+
if (s === 46 && (l = !0, s = i.charCodeAt(++r), r = z(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (l = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = z(e, r, s), s = i.charCodeAt(r)), s === 46 || Ne(s)) throw f(e.source, r, `Invalid number, expected digit but got: ${b(e, r)}.`);
|
|
564
|
+
return d(e, l ? a.FLOAT : a.INT, t, r, i.slice(t, r));
|
|
565
|
+
}
|
|
566
|
+
function z(e, t, n) {
|
|
567
|
+
if (!B(n)) throw f(e.source, t, `Invalid number, expected digit but got: ${b(e, t)}.`);
|
|
568
|
+
let i = e.source.body, r = t + 1;
|
|
569
|
+
for (; B(i.charCodeAt(r)); ) ++r;
|
|
570
|
+
return r;
|
|
571
|
+
}
|
|
572
|
+
function Gt(e, t) {
|
|
573
|
+
let n = e.source.body, i = n.length, r = t + 1, s = r, l = "";
|
|
574
|
+
for (; r < i; ) {
|
|
575
|
+
let c = n.charCodeAt(r);
|
|
576
|
+
if (c === 34) return l += n.slice(s, r), d(e, a.STRING, t, r + 1, l);
|
|
577
|
+
if (c === 92) {
|
|
578
|
+
l += n.slice(s, r);
|
|
579
|
+
let p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Yt(e, r) : qt(e, r) : Jt(e, r);
|
|
580
|
+
l += p.value, r += p.size, s = r;
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
583
|
+
if (c === 10 || c === 13) break;
|
|
584
|
+
if (F(c)) ++r;
|
|
585
|
+
else if ($(n, r)) r += 2;
|
|
586
|
+
else throw f(e.source, r, `Invalid character within String: ${b(e, r)}.`);
|
|
587
|
+
}
|
|
588
|
+
throw f(e.source, r, "Unterminated string.");
|
|
589
|
+
}
|
|
590
|
+
function Yt(e, t) {
|
|
591
|
+
let n = e.source.body, i = 0, r = 3;
|
|
592
|
+
for (; r < 12; ) {
|
|
593
|
+
let s = n.charCodeAt(t + r++);
|
|
594
|
+
if (s === 125) {
|
|
595
|
+
if (r < 5 || !F(i)) break;
|
|
596
|
+
return { value: String.fromCodePoint(i), size: r };
|
|
597
|
+
}
|
|
598
|
+
if (i = i << 4 | j(s), i < 0) break;
|
|
599
|
+
}
|
|
600
|
+
throw f(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + r)}".`);
|
|
601
|
+
}
|
|
602
|
+
function qt(e, t) {
|
|
603
|
+
let n = e.source.body, i = ye(n, t + 2);
|
|
604
|
+
if (F(i)) return { value: String.fromCodePoint(i), size: 6 };
|
|
605
|
+
if (Ie(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
606
|
+
let r = ye(n, t + 8);
|
|
607
|
+
if (ve(r)) return { value: String.fromCodePoint(i, r), size: 12 };
|
|
608
|
+
}
|
|
609
|
+
throw f(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
|
|
610
|
+
}
|
|
611
|
+
function ye(e, t) {
|
|
612
|
+
return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
|
|
613
|
+
}
|
|
614
|
+
function j(e) {
|
|
615
|
+
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
616
|
+
}
|
|
617
|
+
function Jt(e, t) {
|
|
618
|
+
let n = e.source.body;
|
|
619
|
+
switch (n.charCodeAt(t + 1)) {
|
|
620
|
+
case 34:
|
|
621
|
+
return { value: '"', size: 2 };
|
|
622
|
+
case 92:
|
|
623
|
+
return { value: "\\", size: 2 };
|
|
624
|
+
case 47:
|
|
625
|
+
return { value: "/", size: 2 };
|
|
626
|
+
case 98:
|
|
627
|
+
return { value: "\b", size: 2 };
|
|
628
|
+
case 102:
|
|
629
|
+
return { value: "\f", size: 2 };
|
|
630
|
+
case 110:
|
|
631
|
+
return { value: `
|
|
632
|
+
`, size: 2 };
|
|
633
|
+
case 114:
|
|
634
|
+
return { value: "\r", size: 2 };
|
|
635
|
+
case 116:
|
|
636
|
+
return { value: " ", size: 2 };
|
|
637
|
+
}
|
|
638
|
+
throw f(e.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
|
|
639
|
+
}
|
|
640
|
+
function Qt(e, t) {
|
|
641
|
+
let n = e.source.body, i = n.length, r = e.lineStart, s = t + 3, l = s, c = "", p = [];
|
|
642
|
+
for (; s < i; ) {
|
|
643
|
+
let y = n.charCodeAt(s);
|
|
644
|
+
if (y === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
645
|
+
c += n.slice(l, s), p.push(c);
|
|
646
|
+
let E = d(e, a.BLOCK_STRING, t, s + 3, Mt(p).join(`
|
|
647
|
+
`));
|
|
648
|
+
return e.line += p.length - 1, e.lineStart = r, E;
|
|
649
|
+
}
|
|
650
|
+
if (y === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
651
|
+
c += n.slice(l, s), l = s + 1, s += 4;
|
|
652
|
+
continue;
|
|
653
|
+
}
|
|
654
|
+
if (y === 10 || y === 13) {
|
|
655
|
+
c += n.slice(l, s), p.push(c), y === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", l = s, r = s;
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
658
|
+
if (F(y)) ++s;
|
|
659
|
+
else if ($(n, s)) s += 2;
|
|
660
|
+
else throw f(e.source, s, `Invalid character within String: ${b(e, s)}.`);
|
|
661
|
+
}
|
|
662
|
+
throw f(e.source, s, "Unterminated string.");
|
|
663
|
+
}
|
|
664
|
+
function Xt(e, t) {
|
|
665
|
+
let n = e.source.body, i = n.length, r = t + 1;
|
|
666
|
+
for (; r < i; ) {
|
|
667
|
+
let s = n.charCodeAt(r);
|
|
668
|
+
if (Pt(s)) ++r;
|
|
669
|
+
else break;
|
|
670
|
+
}
|
|
671
|
+
return d(e, a.NAME, t, r, n.slice(t, r));
|
|
672
|
+
}
|
|
673
|
+
function H(e, t) {
|
|
674
|
+
throw new Error(t);
|
|
675
|
+
}
|
|
676
|
+
function Oe(e) {
|
|
677
|
+
return K(e, []);
|
|
678
|
+
}
|
|
679
|
+
function K(e, t) {
|
|
680
|
+
switch (typeof e) {
|
|
681
|
+
case "string":
|
|
682
|
+
return JSON.stringify(e);
|
|
683
|
+
case "function":
|
|
684
|
+
return e.name ? `[function ${e.name}]` : "[function]";
|
|
685
|
+
case "object":
|
|
686
|
+
return zt(e, t);
|
|
687
|
+
default:
|
|
688
|
+
return String(e);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
function zt(e, t) {
|
|
692
|
+
if (e === null) return "null";
|
|
693
|
+
if (t.includes(e)) return "[Circular]";
|
|
694
|
+
let n = [...t, e];
|
|
695
|
+
if (Ht(e)) {
|
|
696
|
+
let i = e.toJSON();
|
|
697
|
+
if (i !== e) return typeof i == "string" ? i : K(i, n);
|
|
698
|
+
} else if (Array.isArray(e)) return Zt(e, n);
|
|
699
|
+
return Wt(e, n);
|
|
700
|
+
}
|
|
701
|
+
function Ht(e) {
|
|
702
|
+
return typeof e.toJSON == "function";
|
|
703
|
+
}
|
|
704
|
+
function Wt(e, t) {
|
|
705
|
+
let n = Object.entries(e);
|
|
706
|
+
return n.length === 0 ? "{}" : t.length > 2 ? "[" + en(e) + "]" : "{ " + n.map(([i, r]) => i + ": " + K(r, t)).join(", ") + " }";
|
|
707
|
+
}
|
|
708
|
+
function Zt(e, t) {
|
|
709
|
+
if (e.length === 0) return "[]";
|
|
710
|
+
if (t.length > 2) return "[Array]";
|
|
711
|
+
let n = Math.min(10, e.length), i = e.length - n, r = [];
|
|
712
|
+
for (let s = 0; s < n; ++s) r.push(K(e[s], t));
|
|
713
|
+
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
714
|
+
}
|
|
715
|
+
function en(e) {
|
|
716
|
+
let t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
717
|
+
if (t === "Object" && typeof e.constructor == "function") {
|
|
718
|
+
let n = e.constructor.name;
|
|
719
|
+
if (typeof n == "string" && n !== "") return n;
|
|
720
|
+
}
|
|
721
|
+
return t;
|
|
722
|
+
}
|
|
723
|
+
var tn = globalThis.process && !0, nn = tn ? function(e, t) {
|
|
724
|
+
return e instanceof t;
|
|
725
|
+
} : function(e, t) {
|
|
726
|
+
if (e instanceof t) return !0;
|
|
727
|
+
if (typeof e == "object" && e !== null) {
|
|
728
|
+
var n;
|
|
729
|
+
let i = t.prototype[Symbol.toStringTag], r = Symbol.toStringTag in e ? e[Symbol.toStringTag] : (n = e.constructor) === null || n === void 0 ? void 0 : n.name;
|
|
730
|
+
if (i === r) {
|
|
731
|
+
let s = Oe(e);
|
|
732
|
+
throw new Error(`Cannot use ${i} "${s}" from another module or realm.
|
|
733
|
+
|
|
734
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
735
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
736
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
737
|
+
|
|
738
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
739
|
+
|
|
740
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
741
|
+
versions may have different capabilities and behavior. The data from one
|
|
742
|
+
version used in the function from another could produce confusing and
|
|
743
|
+
spurious results.`);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
return !1;
|
|
747
|
+
}, De = class {
|
|
748
|
+
constructor(e, t = "GraphQL request", n = { line: 1, column: 1 }) {
|
|
749
|
+
typeof e == "string" || H(!1, `Body must be a string. Received: ${Oe(e)}.`), this.body = e, this.name = t, this.locationOffset = n, this.locationOffset.line > 0 || H(!1, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || H(!1, "column in locationOffset is 1-indexed and must be positive.");
|
|
750
|
+
}
|
|
751
|
+
get [Symbol.toStringTag]() {
|
|
752
|
+
return "Source";
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
function rn(e) {
|
|
756
|
+
return nn(e, De);
|
|
757
|
+
}
|
|
758
|
+
function sn(e, t) {
|
|
759
|
+
let n = new an(e, t), i = n.parseDocument();
|
|
760
|
+
return Object.defineProperty(i, "tokenCount", { enumerable: !1, value: n.tokenCount }), i;
|
|
761
|
+
}
|
|
762
|
+
var an = class {
|
|
763
|
+
constructor(e, t = {}) {
|
|
764
|
+
let { lexer: n, ...i } = t;
|
|
765
|
+
if (n) this._lexer = n;
|
|
766
|
+
else {
|
|
767
|
+
let r = rn(e) ? e : new De(e);
|
|
768
|
+
this._lexer = new Vt(r);
|
|
769
|
+
}
|
|
770
|
+
this._options = i, this._tokenCounter = 0;
|
|
771
|
+
}
|
|
772
|
+
get tokenCount() {
|
|
773
|
+
return this._tokenCounter;
|
|
774
|
+
}
|
|
775
|
+
parseName() {
|
|
776
|
+
let e = this.expectToken(a.NAME);
|
|
777
|
+
return this.node(e, { kind: o.NAME, value: e.value });
|
|
778
|
+
}
|
|
779
|
+
parseDocument() {
|
|
780
|
+
return this.node(this._lexer.token, { kind: o.DOCUMENT, definitions: this.many(a.SOF, this.parseDefinition, a.EOF) });
|
|
781
|
+
}
|
|
782
|
+
parseDefinition() {
|
|
783
|
+
if (this.peek(a.BRACE_L)) return this.parseOperationDefinition();
|
|
784
|
+
let e = this.peekDescription(), t = e ? this._lexer.lookahead() : this._lexer.token;
|
|
785
|
+
if (e && t.kind === a.BRACE_L) throw f(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are not supported on shorthand queries.");
|
|
786
|
+
if (t.kind === a.NAME) {
|
|
787
|
+
switch (t.value) {
|
|
788
|
+
case "schema":
|
|
789
|
+
return this.parseSchemaDefinition();
|
|
790
|
+
case "scalar":
|
|
791
|
+
return this.parseScalarTypeDefinition();
|
|
792
|
+
case "type":
|
|
793
|
+
return this.parseObjectTypeDefinition();
|
|
794
|
+
case "interface":
|
|
795
|
+
return this.parseInterfaceTypeDefinition();
|
|
796
|
+
case "union":
|
|
797
|
+
return this.parseUnionTypeDefinition();
|
|
798
|
+
case "enum":
|
|
799
|
+
return this.parseEnumTypeDefinition();
|
|
800
|
+
case "input":
|
|
801
|
+
return this.parseInputObjectTypeDefinition();
|
|
802
|
+
case "directive":
|
|
803
|
+
return this.parseDirectiveDefinition();
|
|
804
|
+
}
|
|
805
|
+
switch (t.value) {
|
|
806
|
+
case "query":
|
|
807
|
+
case "mutation":
|
|
808
|
+
case "subscription":
|
|
809
|
+
return this.parseOperationDefinition();
|
|
810
|
+
case "fragment":
|
|
811
|
+
return this.parseFragmentDefinition();
|
|
812
|
+
}
|
|
813
|
+
if (e) throw f(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
|
|
814
|
+
switch (t.value) {
|
|
815
|
+
case "extend":
|
|
816
|
+
return this.parseTypeSystemExtension();
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
throw this.unexpected(t);
|
|
820
|
+
}
|
|
821
|
+
parseOperationDefinition() {
|
|
822
|
+
let e = this._lexer.token;
|
|
823
|
+
if (this.peek(a.BRACE_L)) return this.node(e, { kind: o.OPERATION_DEFINITION, operation: L.QUERY, description: void 0, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
|
|
824
|
+
let t = this.parseDescription(), n = this.parseOperationType(), i;
|
|
825
|
+
return this.peek(a.NAME) && (i = this.parseName()), this.node(e, { kind: o.OPERATION_DEFINITION, operation: n, description: t, name: i, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
|
|
826
|
+
}
|
|
827
|
+
parseOperationType() {
|
|
828
|
+
let e = this.expectToken(a.NAME);
|
|
829
|
+
switch (e.value) {
|
|
830
|
+
case "query":
|
|
831
|
+
return L.QUERY;
|
|
832
|
+
case "mutation":
|
|
833
|
+
return L.MUTATION;
|
|
834
|
+
case "subscription":
|
|
835
|
+
return L.SUBSCRIPTION;
|
|
836
|
+
}
|
|
837
|
+
throw this.unexpected(e);
|
|
838
|
+
}
|
|
839
|
+
parseVariableDefinitions() {
|
|
840
|
+
return this.optionalMany(a.PAREN_L, this.parseVariableDefinition, a.PAREN_R);
|
|
841
|
+
}
|
|
842
|
+
parseVariableDefinition() {
|
|
843
|
+
return this.node(this._lexer.token, { kind: o.VARIABLE_DEFINITION, description: this.parseDescription(), variable: this.parseVariable(), type: (this.expectToken(a.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(a.EQUALS) ? this.parseConstValueLiteral() : void 0, directives: this.parseConstDirectives() });
|
|
844
|
+
}
|
|
845
|
+
parseVariable() {
|
|
846
|
+
let e = this._lexer.token;
|
|
847
|
+
return this.expectToken(a.DOLLAR), this.node(e, { kind: o.VARIABLE, name: this.parseName() });
|
|
848
|
+
}
|
|
849
|
+
parseSelectionSet() {
|
|
850
|
+
return this.node(this._lexer.token, { kind: o.SELECTION_SET, selections: this.many(a.BRACE_L, this.parseSelection, a.BRACE_R) });
|
|
851
|
+
}
|
|
852
|
+
parseSelection() {
|
|
853
|
+
return this.peek(a.SPREAD) ? this.parseFragment() : this.parseField();
|
|
854
|
+
}
|
|
855
|
+
parseField() {
|
|
856
|
+
let e = this._lexer.token, t = this.parseName(), n, i;
|
|
857
|
+
return this.expectOptionalToken(a.COLON) ? (n = t, i = this.parseName()) : i = t, this.node(e, { kind: o.FIELD, alias: n, name: i, arguments: this.parseArguments(!1), directives: this.parseDirectives(!1), selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0 });
|
|
858
|
+
}
|
|
859
|
+
parseArguments(e) {
|
|
860
|
+
let t = e ? this.parseConstArgument : this.parseArgument;
|
|
861
|
+
return this.optionalMany(a.PAREN_L, t, a.PAREN_R);
|
|
862
|
+
}
|
|
863
|
+
parseArgument(e = !1) {
|
|
864
|
+
let t = this._lexer.token, n = this.parseName();
|
|
865
|
+
return this.expectToken(a.COLON), this.node(t, { kind: o.ARGUMENT, name: n, value: this.parseValueLiteral(e) });
|
|
866
|
+
}
|
|
867
|
+
parseConstArgument() {
|
|
868
|
+
return this.parseArgument(!0);
|
|
869
|
+
}
|
|
870
|
+
parseFragment() {
|
|
871
|
+
let e = this._lexer.token;
|
|
872
|
+
this.expectToken(a.SPREAD);
|
|
873
|
+
let t = this.expectOptionalKeyword("on");
|
|
874
|
+
return !t && this.peek(a.NAME) ? this.node(e, { kind: o.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(!1) }) : this.node(e, { kind: o.INLINE_FRAGMENT, typeCondition: t ? this.parseNamedType() : void 0, directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
|
|
875
|
+
}
|
|
876
|
+
parseFragmentDefinition() {
|
|
877
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
878
|
+
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, { kind: o.FRAGMENT_DEFINITION, description: t, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() }) : this.node(e, { kind: o.FRAGMENT_DEFINITION, description: t, name: this.parseFragmentName(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
|
|
879
|
+
}
|
|
880
|
+
parseFragmentName() {
|
|
881
|
+
if (this._lexer.token.value === "on") throw this.unexpected();
|
|
882
|
+
return this.parseName();
|
|
883
|
+
}
|
|
884
|
+
parseValueLiteral(e) {
|
|
885
|
+
let t = this._lexer.token;
|
|
886
|
+
switch (t.kind) {
|
|
887
|
+
case a.BRACKET_L:
|
|
888
|
+
return this.parseList(e);
|
|
889
|
+
case a.BRACE_L:
|
|
890
|
+
return this.parseObject(e);
|
|
891
|
+
case a.INT:
|
|
892
|
+
return this.advanceLexer(), this.node(t, { kind: o.INT, value: t.value });
|
|
893
|
+
case a.FLOAT:
|
|
894
|
+
return this.advanceLexer(), this.node(t, { kind: o.FLOAT, value: t.value });
|
|
895
|
+
case a.STRING:
|
|
896
|
+
case a.BLOCK_STRING:
|
|
897
|
+
return this.parseStringLiteral();
|
|
898
|
+
case a.NAME:
|
|
899
|
+
switch (this.advanceLexer(), t.value) {
|
|
900
|
+
case "true":
|
|
901
|
+
return this.node(t, { kind: o.BOOLEAN, value: !0 });
|
|
902
|
+
case "false":
|
|
903
|
+
return this.node(t, { kind: o.BOOLEAN, value: !1 });
|
|
904
|
+
case "null":
|
|
905
|
+
return this.node(t, { kind: o.NULL });
|
|
906
|
+
default:
|
|
907
|
+
return this.node(t, { kind: o.ENUM, value: t.value });
|
|
908
|
+
}
|
|
909
|
+
case a.DOLLAR:
|
|
910
|
+
if (e) if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
|
|
911
|
+
let n = this._lexer.token.value;
|
|
912
|
+
throw f(this._lexer.source, t.start, `Unexpected variable "$${n}" in constant value.`);
|
|
913
|
+
} else throw this.unexpected(t);
|
|
914
|
+
return this.parseVariable();
|
|
915
|
+
default:
|
|
916
|
+
throw this.unexpected();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
parseConstValueLiteral() {
|
|
920
|
+
return this.parseValueLiteral(!0);
|
|
921
|
+
}
|
|
922
|
+
parseStringLiteral() {
|
|
923
|
+
let e = this._lexer.token;
|
|
924
|
+
return this.advanceLexer(), this.node(e, { kind: o.STRING, value: e.value, block: e.kind === a.BLOCK_STRING });
|
|
925
|
+
}
|
|
926
|
+
parseList(e) {
|
|
927
|
+
let t = () => this.parseValueLiteral(e);
|
|
928
|
+
return this.node(this._lexer.token, { kind: o.LIST, values: this.any(a.BRACKET_L, t, a.BRACKET_R) });
|
|
929
|
+
}
|
|
930
|
+
parseObject(e) {
|
|
931
|
+
let t = () => this.parseObjectField(e);
|
|
932
|
+
return this.node(this._lexer.token, { kind: o.OBJECT, fields: this.any(a.BRACE_L, t, a.BRACE_R) });
|
|
933
|
+
}
|
|
934
|
+
parseObjectField(e) {
|
|
935
|
+
let t = this._lexer.token, n = this.parseName();
|
|
936
|
+
return this.expectToken(a.COLON), this.node(t, { kind: o.OBJECT_FIELD, name: n, value: this.parseValueLiteral(e) });
|
|
937
|
+
}
|
|
938
|
+
parseDirectives(e) {
|
|
939
|
+
let t = [];
|
|
940
|
+
for (; this.peek(a.AT); ) t.push(this.parseDirective(e));
|
|
941
|
+
return t;
|
|
942
|
+
}
|
|
943
|
+
parseConstDirectives() {
|
|
944
|
+
return this.parseDirectives(!0);
|
|
945
|
+
}
|
|
946
|
+
parseDirective(e) {
|
|
947
|
+
let t = this._lexer.token;
|
|
948
|
+
return this.expectToken(a.AT), this.node(t, { kind: o.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(e) });
|
|
949
|
+
}
|
|
950
|
+
parseTypeReference() {
|
|
951
|
+
let e = this._lexer.token, t;
|
|
952
|
+
if (this.expectOptionalToken(a.BRACKET_L)) {
|
|
953
|
+
let n = this.parseTypeReference();
|
|
954
|
+
this.expectToken(a.BRACKET_R), t = this.node(e, { kind: o.LIST_TYPE, type: n });
|
|
955
|
+
} else t = this.parseNamedType();
|
|
956
|
+
return this.expectOptionalToken(a.BANG) ? this.node(e, { kind: o.NON_NULL_TYPE, type: t }) : t;
|
|
957
|
+
}
|
|
958
|
+
parseNamedType() {
|
|
959
|
+
return this.node(this._lexer.token, { kind: o.NAMED_TYPE, name: this.parseName() });
|
|
960
|
+
}
|
|
961
|
+
peekDescription() {
|
|
962
|
+
return this.peek(a.STRING) || this.peek(a.BLOCK_STRING);
|
|
963
|
+
}
|
|
964
|
+
parseDescription() {
|
|
965
|
+
if (this.peekDescription()) return this.parseStringLiteral();
|
|
966
|
+
}
|
|
967
|
+
parseSchemaDefinition() {
|
|
968
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
969
|
+
this.expectKeyword("schema");
|
|
970
|
+
let n = this.parseConstDirectives(), i = this.many(a.BRACE_L, this.parseOperationTypeDefinition, a.BRACE_R);
|
|
971
|
+
return this.node(e, { kind: o.SCHEMA_DEFINITION, description: t, directives: n, operationTypes: i });
|
|
972
|
+
}
|
|
973
|
+
parseOperationTypeDefinition() {
|
|
974
|
+
let e = this._lexer.token, t = this.parseOperationType();
|
|
975
|
+
this.expectToken(a.COLON);
|
|
976
|
+
let n = this.parseNamedType();
|
|
977
|
+
return this.node(e, { kind: o.OPERATION_TYPE_DEFINITION, operation: t, type: n });
|
|
978
|
+
}
|
|
979
|
+
parseScalarTypeDefinition() {
|
|
980
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
981
|
+
this.expectKeyword("scalar");
|
|
982
|
+
let n = this.parseName(), i = this.parseConstDirectives();
|
|
983
|
+
return this.node(e, { kind: o.SCALAR_TYPE_DEFINITION, description: t, name: n, directives: i });
|
|
984
|
+
}
|
|
985
|
+
parseObjectTypeDefinition() {
|
|
986
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
987
|
+
this.expectKeyword("type");
|
|
988
|
+
let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
989
|
+
return this.node(e, { kind: o.OBJECT_TYPE_DEFINITION, description: t, name: n, interfaces: i, directives: r, fields: s });
|
|
990
|
+
}
|
|
991
|
+
parseImplementsInterfaces() {
|
|
992
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(a.AMP, this.parseNamedType) : [];
|
|
993
|
+
}
|
|
994
|
+
parseFieldsDefinition() {
|
|
995
|
+
return this.optionalMany(a.BRACE_L, this.parseFieldDefinition, a.BRACE_R);
|
|
996
|
+
}
|
|
997
|
+
parseFieldDefinition() {
|
|
998
|
+
let e = this._lexer.token, t = this.parseDescription(), n = this.parseName(), i = this.parseArgumentDefs();
|
|
999
|
+
this.expectToken(a.COLON);
|
|
1000
|
+
let r = this.parseTypeReference(), s = this.parseConstDirectives();
|
|
1001
|
+
return this.node(e, { kind: o.FIELD_DEFINITION, description: t, name: n, arguments: i, type: r, directives: s });
|
|
1002
|
+
}
|
|
1003
|
+
parseArgumentDefs() {
|
|
1004
|
+
return this.optionalMany(a.PAREN_L, this.parseInputValueDef, a.PAREN_R);
|
|
1005
|
+
}
|
|
1006
|
+
parseInputValueDef() {
|
|
1007
|
+
let e = this._lexer.token, t = this.parseDescription(), n = this.parseName();
|
|
1008
|
+
this.expectToken(a.COLON);
|
|
1009
|
+
let i = this.parseTypeReference(), r;
|
|
1010
|
+
this.expectOptionalToken(a.EQUALS) && (r = this.parseConstValueLiteral());
|
|
1011
|
+
let s = this.parseConstDirectives();
|
|
1012
|
+
return this.node(e, { kind: o.INPUT_VALUE_DEFINITION, description: t, name: n, type: i, defaultValue: r, directives: s });
|
|
1013
|
+
}
|
|
1014
|
+
parseInterfaceTypeDefinition() {
|
|
1015
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1016
|
+
this.expectKeyword("interface");
|
|
1017
|
+
let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1018
|
+
return this.node(e, { kind: o.INTERFACE_TYPE_DEFINITION, description: t, name: n, interfaces: i, directives: r, fields: s });
|
|
1019
|
+
}
|
|
1020
|
+
parseUnionTypeDefinition() {
|
|
1021
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1022
|
+
this.expectKeyword("union");
|
|
1023
|
+
let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
1024
|
+
return this.node(e, { kind: o.UNION_TYPE_DEFINITION, description: t, name: n, directives: i, types: r });
|
|
1025
|
+
}
|
|
1026
|
+
parseUnionMemberTypes() {
|
|
1027
|
+
return this.expectOptionalToken(a.EQUALS) ? this.delimitedMany(a.PIPE, this.parseNamedType) : [];
|
|
1028
|
+
}
|
|
1029
|
+
parseEnumTypeDefinition() {
|
|
1030
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1031
|
+
this.expectKeyword("enum");
|
|
1032
|
+
let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
1033
|
+
return this.node(e, { kind: o.ENUM_TYPE_DEFINITION, description: t, name: n, directives: i, values: r });
|
|
1034
|
+
}
|
|
1035
|
+
parseEnumValuesDefinition() {
|
|
1036
|
+
return this.optionalMany(a.BRACE_L, this.parseEnumValueDefinition, a.BRACE_R);
|
|
1037
|
+
}
|
|
1038
|
+
parseEnumValueDefinition() {
|
|
1039
|
+
let e = this._lexer.token, t = this.parseDescription(), n = this.parseEnumValueName(), i = this.parseConstDirectives();
|
|
1040
|
+
return this.node(e, { kind: o.ENUM_VALUE_DEFINITION, description: t, name: n, directives: i });
|
|
1041
|
+
}
|
|
1042
|
+
parseEnumValueName() {
|
|
1043
|
+
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, `${G(this._lexer.token)} is reserved and cannot be used for an enum value.`);
|
|
1044
|
+
return this.parseName();
|
|
1045
|
+
}
|
|
1046
|
+
parseInputObjectTypeDefinition() {
|
|
1047
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1048
|
+
this.expectKeyword("input");
|
|
1049
|
+
let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
1050
|
+
return this.node(e, { kind: o.INPUT_OBJECT_TYPE_DEFINITION, description: t, name: n, directives: i, fields: r });
|
|
1051
|
+
}
|
|
1052
|
+
parseInputFieldsDefinition() {
|
|
1053
|
+
return this.optionalMany(a.BRACE_L, this.parseInputValueDef, a.BRACE_R);
|
|
1054
|
+
}
|
|
1055
|
+
parseTypeSystemExtension() {
|
|
1056
|
+
let e = this._lexer.lookahead();
|
|
1057
|
+
if (e.kind === a.NAME) switch (e.value) {
|
|
1058
|
+
case "schema":
|
|
1059
|
+
return this.parseSchemaExtension();
|
|
1060
|
+
case "scalar":
|
|
1061
|
+
return this.parseScalarTypeExtension();
|
|
1062
|
+
case "type":
|
|
1063
|
+
return this.parseObjectTypeExtension();
|
|
1064
|
+
case "interface":
|
|
1065
|
+
return this.parseInterfaceTypeExtension();
|
|
1066
|
+
case "union":
|
|
1067
|
+
return this.parseUnionTypeExtension();
|
|
1068
|
+
case "enum":
|
|
1069
|
+
return this.parseEnumTypeExtension();
|
|
1070
|
+
case "input":
|
|
1071
|
+
return this.parseInputObjectTypeExtension();
|
|
1072
|
+
}
|
|
1073
|
+
throw this.unexpected(e);
|
|
1074
|
+
}
|
|
1075
|
+
parseSchemaExtension() {
|
|
1076
|
+
let e = this._lexer.token;
|
|
1077
|
+
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1078
|
+
let t = this.parseConstDirectives(), n = this.optionalMany(a.BRACE_L, this.parseOperationTypeDefinition, a.BRACE_R);
|
|
1079
|
+
if (t.length === 0 && n.length === 0) throw this.unexpected();
|
|
1080
|
+
return this.node(e, { kind: o.SCHEMA_EXTENSION, directives: t, operationTypes: n });
|
|
1081
|
+
}
|
|
1082
|
+
parseScalarTypeExtension() {
|
|
1083
|
+
let e = this._lexer.token;
|
|
1084
|
+
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1085
|
+
let t = this.parseName(), n = this.parseConstDirectives();
|
|
1086
|
+
if (n.length === 0) throw this.unexpected();
|
|
1087
|
+
return this.node(e, { kind: o.SCALAR_TYPE_EXTENSION, name: t, directives: n });
|
|
1088
|
+
}
|
|
1089
|
+
parseObjectTypeExtension() {
|
|
1090
|
+
let e = this._lexer.token;
|
|
1091
|
+
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1092
|
+
let t = this.parseName(), n = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), r = this.parseFieldsDefinition();
|
|
1093
|
+
if (n.length === 0 && i.length === 0 && r.length === 0) throw this.unexpected();
|
|
1094
|
+
return this.node(e, { kind: o.OBJECT_TYPE_EXTENSION, name: t, interfaces: n, directives: i, fields: r });
|
|
1095
|
+
}
|
|
1096
|
+
parseInterfaceTypeExtension() {
|
|
1097
|
+
let e = this._lexer.token;
|
|
1098
|
+
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1099
|
+
let t = this.parseName(), n = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), r = this.parseFieldsDefinition();
|
|
1100
|
+
if (n.length === 0 && i.length === 0 && r.length === 0) throw this.unexpected();
|
|
1101
|
+
return this.node(e, { kind: o.INTERFACE_TYPE_EXTENSION, name: t, interfaces: n, directives: i, fields: r });
|
|
1102
|
+
}
|
|
1103
|
+
parseUnionTypeExtension() {
|
|
1104
|
+
let e = this._lexer.token;
|
|
1105
|
+
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1106
|
+
let t = this.parseName(), n = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
|
|
1107
|
+
if (n.length === 0 && i.length === 0) throw this.unexpected();
|
|
1108
|
+
return this.node(e, { kind: o.UNION_TYPE_EXTENSION, name: t, directives: n, types: i });
|
|
1109
|
+
}
|
|
1110
|
+
parseEnumTypeExtension() {
|
|
1111
|
+
let e = this._lexer.token;
|
|
1112
|
+
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1113
|
+
let t = this.parseName(), n = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
|
|
1114
|
+
if (n.length === 0 && i.length === 0) throw this.unexpected();
|
|
1115
|
+
return this.node(e, { kind: o.ENUM_TYPE_EXTENSION, name: t, directives: n, values: i });
|
|
1116
|
+
}
|
|
1117
|
+
parseInputObjectTypeExtension() {
|
|
1118
|
+
let e = this._lexer.token;
|
|
1119
|
+
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1120
|
+
let t = this.parseName(), n = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
|
|
1121
|
+
if (n.length === 0 && i.length === 0) throw this.unexpected();
|
|
1122
|
+
return this.node(e, { kind: o.INPUT_OBJECT_TYPE_EXTENSION, name: t, directives: n, fields: i });
|
|
1123
|
+
}
|
|
1124
|
+
parseDirectiveDefinition() {
|
|
1125
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1126
|
+
this.expectKeyword("directive"), this.expectToken(a.AT);
|
|
1127
|
+
let n = this.parseName(), i = this.parseArgumentDefs(), r = this.expectOptionalKeyword("repeatable");
|
|
1128
|
+
this.expectKeyword("on");
|
|
1129
|
+
let s = this.parseDirectiveLocations();
|
|
1130
|
+
return this.node(e, { kind: o.DIRECTIVE_DEFINITION, description: t, name: n, arguments: i, repeatable: r, locations: s });
|
|
1131
|
+
}
|
|
1132
|
+
parseDirectiveLocations() {
|
|
1133
|
+
return this.delimitedMany(a.PIPE, this.parseDirectiveLocation);
|
|
1134
|
+
}
|
|
1135
|
+
parseDirectiveLocation() {
|
|
1136
|
+
let e = this._lexer.token, t = this.parseName();
|
|
1137
|
+
if (Object.prototype.hasOwnProperty.call(X, t.value)) return t;
|
|
1138
|
+
throw this.unexpected(e);
|
|
1139
|
+
}
|
|
1140
|
+
parseSchemaCoordinate() {
|
|
1141
|
+
let e = this._lexer.token, t = this.expectOptionalToken(a.AT), n = this.parseName(), i;
|
|
1142
|
+
!t && this.expectOptionalToken(a.DOT) && (i = this.parseName());
|
|
1143
|
+
let r;
|
|
1144
|
+
return (t || i) && this.expectOptionalToken(a.PAREN_L) && (r = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), t ? r ? this.node(e, { kind: o.DIRECTIVE_ARGUMENT_COORDINATE, name: n, argumentName: r }) : this.node(e, { kind: o.DIRECTIVE_COORDINATE, name: n }) : i ? r ? this.node(e, { kind: o.ARGUMENT_COORDINATE, name: n, fieldName: i, argumentName: r }) : this.node(e, { kind: o.MEMBER_COORDINATE, name: n, memberName: i }) : this.node(e, { kind: o.TYPE_COORDINATE, name: n });
|
|
1145
|
+
}
|
|
1146
|
+
node(e, t) {
|
|
1147
|
+
return this._options.noLocation !== !0 && (t.loc = new ot(e, this._lexer.lastToken, this._lexer.source)), t;
|
|
1148
|
+
}
|
|
1149
|
+
peek(e) {
|
|
1150
|
+
return this._lexer.token.kind === e;
|
|
1151
|
+
}
|
|
1152
|
+
expectToken(e) {
|
|
1153
|
+
let t = this._lexer.token;
|
|
1154
|
+
if (t.kind === e) return this.advanceLexer(), t;
|
|
1155
|
+
throw f(this._lexer.source, t.start, `Expected ${Ae(e)}, found ${G(t)}.`);
|
|
1156
|
+
}
|
|
1157
|
+
expectOptionalToken(e) {
|
|
1158
|
+
return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
|
|
1159
|
+
}
|
|
1160
|
+
expectKeyword(e) {
|
|
1161
|
+
let t = this._lexer.token;
|
|
1162
|
+
if (t.kind === a.NAME && t.value === e) this.advanceLexer();
|
|
1163
|
+
else throw f(this._lexer.source, t.start, `Expected "${e}", found ${G(t)}.`);
|
|
1164
|
+
}
|
|
1165
|
+
expectOptionalKeyword(e) {
|
|
1166
|
+
let t = this._lexer.token;
|
|
1167
|
+
return t.kind === a.NAME && t.value === e ? (this.advanceLexer(), !0) : !1;
|
|
1168
|
+
}
|
|
1169
|
+
unexpected(e) {
|
|
1170
|
+
let t = e ?? this._lexer.token;
|
|
1171
|
+
return f(this._lexer.source, t.start, `Unexpected ${G(t)}.`);
|
|
1172
|
+
}
|
|
1173
|
+
any(e, t, n) {
|
|
1174
|
+
this.expectToken(e);
|
|
1175
|
+
let i = [];
|
|
1176
|
+
for (; !this.expectOptionalToken(n); ) i.push(t.call(this));
|
|
1177
|
+
return i;
|
|
1178
|
+
}
|
|
1179
|
+
optionalMany(e, t, n) {
|
|
1180
|
+
if (this.expectOptionalToken(e)) {
|
|
1181
|
+
let i = [];
|
|
1182
|
+
do
|
|
1183
|
+
i.push(t.call(this));
|
|
1184
|
+
while (!this.expectOptionalToken(n));
|
|
1185
|
+
return i;
|
|
1186
|
+
}
|
|
1187
|
+
return [];
|
|
1188
|
+
}
|
|
1189
|
+
many(e, t, n) {
|
|
1190
|
+
this.expectToken(e);
|
|
1191
|
+
let i = [];
|
|
1192
|
+
do
|
|
1193
|
+
i.push(t.call(this));
|
|
1194
|
+
while (!this.expectOptionalToken(n));
|
|
1195
|
+
return i;
|
|
1196
|
+
}
|
|
1197
|
+
delimitedMany(e, t) {
|
|
1198
|
+
this.expectOptionalToken(e);
|
|
1199
|
+
let n = [];
|
|
1200
|
+
do
|
|
1201
|
+
n.push(t.call(this));
|
|
1202
|
+
while (this.expectOptionalToken(e));
|
|
1203
|
+
return n;
|
|
1204
|
+
}
|
|
1205
|
+
advanceLexer() {
|
|
1206
|
+
let { maxTokens: e } = this._options, t = this._lexer.advance();
|
|
1207
|
+
if (t.kind !== a.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e)) throw f(this._lexer.source, t.start, `Document contains more that ${e} tokens. Parsing aborted.`);
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
function G(e) {
|
|
1211
|
+
let t = e.value;
|
|
1212
|
+
return Ae(e.kind) + (t != null ? ` "${t}"` : "");
|
|
1213
|
+
}
|
|
1214
|
+
function Ae(e) {
|
|
1215
|
+
return Bt(e) ? `"${e}"` : e;
|
|
1216
|
+
}
|
|
1217
|
+
function on(e, t) {
|
|
1218
|
+
let n = new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
|
|
1219
|
+
return Object.assign(n, t);
|
|
1220
|
+
}
|
|
1221
|
+
var ln = on;
|
|
1222
|
+
function cn(e) {
|
|
1223
|
+
let t = [], { startToken: n, endToken: i } = e.loc;
|
|
1224
|
+
for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({ ...r, loc: { start: r.start, end: r.end } });
|
|
1225
|
+
return t;
|
|
1226
|
+
}
|
|
1227
|
+
var un = { allowLegacyFragmentVariables: !0 };
|
|
1228
|
+
function pn(e) {
|
|
1229
|
+
if ((e == null ? void 0 : e.name) === "GraphQLError") {
|
|
1230
|
+
let { message: t, locations: [n] } = e;
|
|
1231
|
+
return ln(t, { loc: { start: n }, cause: e });
|
|
1232
|
+
}
|
|
1233
|
+
return e;
|
|
1234
|
+
}
|
|
1235
|
+
function hn(e) {
|
|
1236
|
+
let t;
|
|
1237
|
+
try {
|
|
1238
|
+
t = sn(e, un);
|
|
1239
|
+
} catch (n) {
|
|
1240
|
+
throw pn(n);
|
|
1241
|
+
}
|
|
1242
|
+
return t.comments = cn(t), t;
|
|
1243
|
+
}
|
|
1244
|
+
var dn = { parse: hn, astFormat: "graphql", hasPragma: ft, hasIgnorePragma: Et, locStart: ce, locEnd: ue }, fn = { graphql: At };
|
|
1245
|
+
return Se(te);
|
|
1246
|
+
});
|
|
1247
|
+
})(Z)), Z.exports;
|
|
1248
|
+
}
|
|
1249
|
+
var ke = /* @__PURE__ */ In();
|
|
1250
|
+
const vn = /* @__PURE__ */ Tn(ke), Dn = /* @__PURE__ */ Nn({
|
|
1251
|
+
__proto__: null,
|
|
1252
|
+
default: vn
|
|
1253
|
+
}, [ke]);
|
|
1254
|
+
export {
|
|
1255
|
+
Dn as g
|
|
1256
|
+
};
|