@0no-co/graphql.web 1.0.13 → 1.1.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/graphql.web.js +438 -534
- package/dist/graphql.web.js.map +1 -1
- package/dist/graphql.web.mjs +421 -490
- package/dist/graphql.web.mjs.map +1 -1
- package/package.json +1 -1
package/dist/graphql.web.mjs
CHANGED
|
@@ -32,33 +32,30 @@ var r = {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
class GraphQLError extends Error {
|
|
35
|
-
constructor(e, r,
|
|
36
|
-
super(e)
|
|
37
|
-
this.name = "GraphQLError";
|
|
38
|
-
this.message = e;
|
|
39
|
-
if (t) {
|
|
35
|
+
constructor(e, r, i, n, t, a, o) {
|
|
36
|
+
if (super(e), this.name = "GraphQLError", this.message = e, t) {
|
|
40
37
|
this.path = t;
|
|
41
38
|
}
|
|
42
39
|
if (r) {
|
|
43
40
|
this.nodes = Array.isArray(r) ? r : [ r ];
|
|
44
41
|
}
|
|
45
|
-
if (n) {
|
|
46
|
-
this.source = n;
|
|
47
|
-
}
|
|
48
42
|
if (i) {
|
|
49
|
-
this.
|
|
43
|
+
this.source = i;
|
|
44
|
+
}
|
|
45
|
+
if (n) {
|
|
46
|
+
this.positions = n;
|
|
50
47
|
}
|
|
51
48
|
if (a) {
|
|
52
49
|
this.originalError = a;
|
|
53
50
|
}
|
|
54
|
-
var
|
|
55
|
-
if (!
|
|
56
|
-
var
|
|
57
|
-
if (
|
|
58
|
-
|
|
51
|
+
var l = o;
|
|
52
|
+
if (!l && a) {
|
|
53
|
+
var d = a.extensions;
|
|
54
|
+
if (d && "object" == typeof d) {
|
|
55
|
+
l = d;
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
|
-
this.extensions =
|
|
58
|
+
this.extensions = l || {};
|
|
62
59
|
}
|
|
63
60
|
toJSON() {
|
|
64
61
|
return {
|
|
@@ -74,18 +71,17 @@ class GraphQLError extends Error {
|
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
var n;
|
|
78
|
-
|
|
79
74
|
var i;
|
|
80
75
|
|
|
76
|
+
var n;
|
|
77
|
+
|
|
81
78
|
function error(e) {
|
|
82
|
-
return new GraphQLError(`Syntax Error: Unexpected token at ${
|
|
79
|
+
return new GraphQLError(`Syntax Error: Unexpected token at ${n} in ${e}`);
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
function advance(e) {
|
|
86
|
-
e.lastIndex = i
|
|
87
|
-
|
|
88
|
-
return n.slice(i, i = e.lastIndex);
|
|
83
|
+
if (e.lastIndex = n, e.test(i)) {
|
|
84
|
+
return i.slice(n, n = e.lastIndex);
|
|
89
85
|
}
|
|
90
86
|
}
|
|
91
87
|
|
|
@@ -93,489 +89,439 @@ var t = / +(?=[^\s])/y;
|
|
|
93
89
|
|
|
94
90
|
function blockString(e) {
|
|
95
91
|
var r = e.split("\n");
|
|
96
|
-
var
|
|
97
|
-
var
|
|
92
|
+
var i = "";
|
|
93
|
+
var n = 0;
|
|
98
94
|
var a = 0;
|
|
99
|
-
var
|
|
100
|
-
for (var
|
|
101
|
-
t.lastIndex = 0
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
i = t.lastIndex;
|
|
95
|
+
var o = r.length - 1;
|
|
96
|
+
for (var l = 0; l < r.length; l++) {
|
|
97
|
+
if (t.lastIndex = 0, t.test(r[l])) {
|
|
98
|
+
if (l && (!n || t.lastIndex < n)) {
|
|
99
|
+
n = t.lastIndex;
|
|
105
100
|
}
|
|
106
|
-
a = a || o;
|
|
107
|
-
l = o;
|
|
101
|
+
a = a || l, o = l;
|
|
108
102
|
}
|
|
109
103
|
}
|
|
110
|
-
for (var
|
|
111
|
-
if (
|
|
112
|
-
|
|
104
|
+
for (var d = a; d <= o; d++) {
|
|
105
|
+
if (d !== a) {
|
|
106
|
+
i += "\n";
|
|
113
107
|
}
|
|
114
|
-
|
|
108
|
+
i += r[d].slice(n).replace(/\\"""/g, '"""');
|
|
115
109
|
}
|
|
116
|
-
return
|
|
110
|
+
return i;
|
|
117
111
|
}
|
|
118
112
|
|
|
119
113
|
function ignored() {
|
|
120
|
-
for (var e = 0 |
|
|
114
|
+
for (var e = 0 | i.charCodeAt(n++); 9 === e || 10 === e || 13 === e || 32 === e || 35 === e || 44 === e || 65279 === e; e = 0 | i.charCodeAt(n++)) {
|
|
121
115
|
if (35 === e) {
|
|
122
|
-
|
|
116
|
+
for (;10 !== (e = i.charCodeAt(n++)) && 13 !== e; ) {}
|
|
123
117
|
}
|
|
124
118
|
}
|
|
125
|
-
|
|
119
|
+
n--;
|
|
126
120
|
}
|
|
127
121
|
|
|
128
|
-
|
|
122
|
+
function name() {
|
|
123
|
+
var e = n;
|
|
124
|
+
for (var r = 0 | i.charCodeAt(n++); r >= 48 && r <= 57 || r >= 65 && r <= 90 || 95 === r || r >= 97 && r <= 122; r = 0 | i.charCodeAt(n++)) {}
|
|
125
|
+
if (e === n - 1) {
|
|
126
|
+
throw error("Name");
|
|
127
|
+
}
|
|
128
|
+
var t = i.slice(e, --n);
|
|
129
|
+
return ignored(), t;
|
|
130
|
+
}
|
|
129
131
|
|
|
130
|
-
|
|
132
|
+
function nameNode() {
|
|
133
|
+
return {
|
|
134
|
+
kind: "Name",
|
|
135
|
+
value: name()
|
|
136
|
+
};
|
|
137
|
+
}
|
|
131
138
|
|
|
132
|
-
var
|
|
133
|
-
e[e.Const = 1] = "Const";
|
|
134
|
-
e[e.Var = 2] = "Var";
|
|
135
|
-
e[e.Int = 3] = "Int";
|
|
136
|
-
e[e.Float = 4] = "Float";
|
|
137
|
-
e[e.BlockString = 5] = "BlockString";
|
|
138
|
-
e[e.String = 6] = "String";
|
|
139
|
-
e[e.Enum = 7] = "Enum";
|
|
140
|
-
return e;
|
|
141
|
-
}(o || {});
|
|
139
|
+
var a = /(?:"""|(?:[\s\S]*?[^\\])""")/y;
|
|
142
140
|
|
|
143
|
-
var
|
|
141
|
+
var o = /(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;
|
|
144
142
|
|
|
145
143
|
function value(e) {
|
|
146
144
|
var r;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
i++;
|
|
157
|
-
ignored();
|
|
158
|
-
return {
|
|
145
|
+
switch (i.charCodeAt(n)) {
|
|
146
|
+
case 91:
|
|
147
|
+
n++, ignored();
|
|
148
|
+
var t = [];
|
|
149
|
+
for (;93 !== i.charCodeAt(n); ) {
|
|
150
|
+
t.push(value(e));
|
|
151
|
+
}
|
|
152
|
+
return n++, ignored(), {
|
|
159
153
|
kind: "ListValue",
|
|
160
|
-
values:
|
|
154
|
+
values: t
|
|
161
155
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
ignored();
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
ignored();
|
|
171
|
-
if (58 !== n.charCodeAt(i++)) {
|
|
156
|
+
|
|
157
|
+
case 123:
|
|
158
|
+
n++, ignored();
|
|
159
|
+
var l = [];
|
|
160
|
+
for (;125 !== i.charCodeAt(n); ) {
|
|
161
|
+
var d = nameNode();
|
|
162
|
+
if (58 !== i.charCodeAt(n++)) {
|
|
172
163
|
throw error("ObjectField");
|
|
173
164
|
}
|
|
174
|
-
ignored()
|
|
175
|
-
s.push({
|
|
165
|
+
ignored(), l.push({
|
|
176
166
|
kind: "ObjectField",
|
|
177
|
-
name:
|
|
178
|
-
kind: "Name",
|
|
179
|
-
value: r
|
|
180
|
-
},
|
|
167
|
+
name: d,
|
|
181
168
|
value: value(e)
|
|
182
169
|
});
|
|
183
170
|
}
|
|
184
|
-
|
|
185
|
-
ignored();
|
|
186
|
-
return {
|
|
171
|
+
return n++, ignored(), {
|
|
187
172
|
kind: "ObjectValue",
|
|
188
|
-
fields:
|
|
173
|
+
fields: l
|
|
189
174
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return {
|
|
205
|
-
kind: "Variable",
|
|
206
|
-
name: {
|
|
207
|
-
kind: "Name",
|
|
208
|
-
value: r
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
} else if (null != (r = t[o.Int])) {
|
|
213
|
-
var v;
|
|
214
|
-
if (null != (v = t[o.Float])) {
|
|
215
|
-
return {
|
|
216
|
-
kind: "FloatValue",
|
|
217
|
-
value: r + v
|
|
218
|
-
};
|
|
219
|
-
} else {
|
|
220
|
-
return {
|
|
221
|
-
kind: "IntValue",
|
|
222
|
-
value: r
|
|
223
|
-
};
|
|
175
|
+
|
|
176
|
+
case 36:
|
|
177
|
+
if (e) {
|
|
178
|
+
throw error("Variable");
|
|
179
|
+
}
|
|
180
|
+
return n++, {
|
|
181
|
+
kind: "Variable",
|
|
182
|
+
name: nameNode()
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
case 34:
|
|
186
|
+
if (34 === i.charCodeAt(n + 1) && 34 === i.charCodeAt(n + 2)) {
|
|
187
|
+
if (n += 3, null == (r = advance(a))) {
|
|
188
|
+
throw error("StringValue");
|
|
224
189
|
}
|
|
225
|
-
|
|
226
|
-
return {
|
|
190
|
+
return ignored(), {
|
|
227
191
|
kind: "StringValue",
|
|
228
|
-
value: blockString(r.slice(
|
|
192
|
+
value: blockString(r.slice(0, -3)),
|
|
229
193
|
block: !0
|
|
230
194
|
};
|
|
231
|
-
} else
|
|
232
|
-
|
|
195
|
+
} else {
|
|
196
|
+
var u = n;
|
|
197
|
+
var s;
|
|
198
|
+
n++;
|
|
199
|
+
var c = !1;
|
|
200
|
+
for (s = 0 | i.charCodeAt(n++); 92 === s && (n++, c = !0) || 10 !== s && 13 !== s && 34 !== s && s; s = 0 | i.charCodeAt(n++)) {}
|
|
201
|
+
if (34 !== s) {
|
|
202
|
+
throw error("StringValue");
|
|
203
|
+
}
|
|
204
|
+
return r = i.slice(u, n), ignored(), {
|
|
233
205
|
kind: "StringValue",
|
|
234
|
-
value:
|
|
206
|
+
value: c ? JSON.parse(r) : r.slice(1, -1),
|
|
235
207
|
block: !1
|
|
236
208
|
};
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
case 45:
|
|
212
|
+
case 48:
|
|
213
|
+
case 49:
|
|
214
|
+
case 50:
|
|
215
|
+
case 51:
|
|
216
|
+
case 52:
|
|
217
|
+
case 53:
|
|
218
|
+
case 54:
|
|
219
|
+
case 55:
|
|
220
|
+
case 56:
|
|
221
|
+
case 57:
|
|
222
|
+
var v = n++;
|
|
223
|
+
var f;
|
|
224
|
+
for (;(f = 0 | i.charCodeAt(n++)) >= 48 && f <= 57; ) {}
|
|
225
|
+
var m = i.slice(v, --n);
|
|
226
|
+
if (46 === (f = i.charCodeAt(n)) || 69 === f || 101 === f) {
|
|
227
|
+
if (null == (r = advance(o))) {
|
|
228
|
+
throw error("FloatValue");
|
|
229
|
+
}
|
|
230
|
+
return ignored(), {
|
|
231
|
+
kind: "FloatValue",
|
|
232
|
+
value: m + r
|
|
233
|
+
};
|
|
234
|
+
} else {
|
|
235
|
+
return ignored(), {
|
|
236
|
+
kind: "IntValue",
|
|
237
|
+
value: m
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
case 110:
|
|
242
|
+
if (117 === i.charCodeAt(n + 1) && 108 === i.charCodeAt(n + 2) && 108 === i.charCodeAt(n + 3)) {
|
|
243
|
+
return n += 4, ignored(), {
|
|
244
|
+
kind: "NullValue"
|
|
245
|
+
};
|
|
246
|
+
} else {
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
case 116:
|
|
251
|
+
if (114 === i.charCodeAt(n + 1) && 117 === i.charCodeAt(n + 2) && 101 === i.charCodeAt(n + 3)) {
|
|
252
|
+
return n += 4, ignored(), {
|
|
253
|
+
kind: "BooleanValue",
|
|
254
|
+
value: !0
|
|
255
|
+
};
|
|
256
|
+
} else {
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
case 102:
|
|
261
|
+
if (97 === i.charCodeAt(n + 1) && 108 === i.charCodeAt(n + 2) && 115 === i.charCodeAt(n + 3) && 101 === i.charCodeAt(n + 4)) {
|
|
262
|
+
return n += 5, ignored(), {
|
|
263
|
+
kind: "BooleanValue",
|
|
264
|
+
value: !1
|
|
241
265
|
};
|
|
266
|
+
} else {
|
|
267
|
+
break;
|
|
242
268
|
}
|
|
243
269
|
}
|
|
244
|
-
|
|
270
|
+
return {
|
|
271
|
+
kind: "EnumValue",
|
|
272
|
+
value: name()
|
|
273
|
+
};
|
|
245
274
|
}
|
|
246
275
|
|
|
247
276
|
function arguments_(e) {
|
|
248
|
-
if (40 ===
|
|
277
|
+
if (40 === i.charCodeAt(n)) {
|
|
249
278
|
var r = [];
|
|
250
|
-
|
|
251
|
-
ignored();
|
|
252
|
-
var t;
|
|
279
|
+
n++, ignored();
|
|
253
280
|
do {
|
|
254
|
-
|
|
281
|
+
var t = nameNode();
|
|
282
|
+
if (58 !== i.charCodeAt(n++)) {
|
|
255
283
|
throw error("Argument");
|
|
256
284
|
}
|
|
257
|
-
ignored()
|
|
258
|
-
if (58 !== n.charCodeAt(i++)) {
|
|
259
|
-
throw error("Argument");
|
|
260
|
-
}
|
|
261
|
-
ignored();
|
|
262
|
-
r.push({
|
|
285
|
+
ignored(), r.push({
|
|
263
286
|
kind: "Argument",
|
|
264
|
-
name:
|
|
265
|
-
kind: "Name",
|
|
266
|
-
value: t
|
|
267
|
-
},
|
|
287
|
+
name: t,
|
|
268
288
|
value: value(e)
|
|
269
289
|
});
|
|
270
|
-
} while (41 !==
|
|
271
|
-
|
|
272
|
-
ignored();
|
|
273
|
-
return r;
|
|
290
|
+
} while (41 !== i.charCodeAt(n));
|
|
291
|
+
return n++, ignored(), r;
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
|
|
277
295
|
function directives(e) {
|
|
278
|
-
if (64 ===
|
|
296
|
+
if (64 === i.charCodeAt(n)) {
|
|
279
297
|
var r = [];
|
|
280
|
-
var t;
|
|
281
298
|
do {
|
|
282
|
-
|
|
283
|
-
if (null == (t = advance(a))) {
|
|
284
|
-
throw error("Directive");
|
|
285
|
-
}
|
|
286
|
-
ignored();
|
|
287
|
-
r.push({
|
|
299
|
+
n++, r.push({
|
|
288
300
|
kind: "Directive",
|
|
289
|
-
name:
|
|
290
|
-
kind: "Name",
|
|
291
|
-
value: t
|
|
292
|
-
},
|
|
301
|
+
name: nameNode(),
|
|
293
302
|
arguments: arguments_(e)
|
|
294
303
|
});
|
|
295
|
-
} while (64 ===
|
|
304
|
+
} while (64 === i.charCodeAt(n));
|
|
296
305
|
return r;
|
|
297
306
|
}
|
|
298
307
|
}
|
|
299
308
|
|
|
300
309
|
function type() {
|
|
301
|
-
var e;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
r++;
|
|
305
|
-
i++;
|
|
306
|
-
ignored();
|
|
310
|
+
var e = 0;
|
|
311
|
+
for (;91 === i.charCodeAt(n); ) {
|
|
312
|
+
e++, n++, ignored();
|
|
307
313
|
}
|
|
308
|
-
|
|
309
|
-
throw error("NamedType");
|
|
310
|
-
}
|
|
311
|
-
ignored();
|
|
312
|
-
var t = {
|
|
314
|
+
var r = {
|
|
313
315
|
kind: "NamedType",
|
|
314
|
-
name:
|
|
315
|
-
kind: "Name",
|
|
316
|
-
value: e
|
|
317
|
-
}
|
|
316
|
+
name: nameNode()
|
|
318
317
|
};
|
|
319
318
|
do {
|
|
320
|
-
if (33 ===
|
|
321
|
-
|
|
322
|
-
ignored();
|
|
323
|
-
t = {
|
|
319
|
+
if (33 === i.charCodeAt(n)) {
|
|
320
|
+
n++, ignored(), r = {
|
|
324
321
|
kind: "NonNullType",
|
|
325
|
-
type:
|
|
322
|
+
type: r
|
|
326
323
|
};
|
|
327
324
|
}
|
|
328
|
-
if (
|
|
329
|
-
if (93 !==
|
|
325
|
+
if (e) {
|
|
326
|
+
if (93 !== i.charCodeAt(n++)) {
|
|
330
327
|
throw error("NamedType");
|
|
331
328
|
}
|
|
332
|
-
ignored()
|
|
333
|
-
t = {
|
|
329
|
+
ignored(), r = {
|
|
334
330
|
kind: "ListType",
|
|
335
|
-
type:
|
|
331
|
+
type: r
|
|
336
332
|
};
|
|
337
333
|
}
|
|
338
|
-
} while (
|
|
339
|
-
return
|
|
334
|
+
} while (e--);
|
|
335
|
+
return r;
|
|
340
336
|
}
|
|
341
337
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}(s || {});
|
|
338
|
+
function selectionSetStart() {
|
|
339
|
+
if (123 !== i.charCodeAt(n++)) {
|
|
340
|
+
throw error("SelectionSet");
|
|
341
|
+
}
|
|
342
|
+
return ignored(), selectionSet();
|
|
343
|
+
}
|
|
349
344
|
|
|
350
345
|
function selectionSet() {
|
|
351
346
|
var e = [];
|
|
352
|
-
var r;
|
|
353
|
-
var t;
|
|
354
347
|
do {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
348
|
+
if (46 === i.charCodeAt(n)) {
|
|
349
|
+
if (46 !== i.charCodeAt(++n) || 46 !== i.charCodeAt(++n)) {
|
|
350
|
+
throw error("SelectionSet");
|
|
351
|
+
}
|
|
352
|
+
switch (n++, ignored(), i.charCodeAt(n)) {
|
|
353
|
+
case 64:
|
|
354
|
+
e.push({
|
|
355
|
+
kind: "InlineFragment",
|
|
356
|
+
typeCondition: void 0,
|
|
357
|
+
directives: directives(!1),
|
|
358
|
+
selectionSet: selectionSetStart()
|
|
359
|
+
});
|
|
360
|
+
break;
|
|
361
|
+
|
|
362
|
+
case 111:
|
|
363
|
+
if (110 === i.charCodeAt(n + 1)) {
|
|
364
|
+
n += 2, ignored(), e.push({
|
|
365
|
+
kind: "InlineFragment",
|
|
366
|
+
typeCondition: {
|
|
367
|
+
kind: "NamedType",
|
|
368
|
+
name: nameNode()
|
|
368
369
|
},
|
|
369
|
-
directives: directives(!1)
|
|
370
|
+
directives: directives(!1),
|
|
371
|
+
selectionSet: selectionSetStart()
|
|
370
372
|
});
|
|
371
373
|
} else {
|
|
372
|
-
ignored();
|
|
373
|
-
if ("on" === l) {
|
|
374
|
-
if (null == (l = advance(a))) {
|
|
375
|
-
throw error("NamedType");
|
|
376
|
-
}
|
|
377
|
-
ignored();
|
|
378
|
-
}
|
|
379
|
-
var o = directives(!1);
|
|
380
|
-
if (123 !== n.charCodeAt(i++)) {
|
|
381
|
-
throw error("InlineFragment");
|
|
382
|
-
}
|
|
383
|
-
ignored();
|
|
384
374
|
e.push({
|
|
385
|
-
kind: "
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
name: {
|
|
389
|
-
kind: "Name",
|
|
390
|
-
value: l
|
|
391
|
-
}
|
|
392
|
-
} : void 0,
|
|
393
|
-
directives: o,
|
|
394
|
-
selectionSet: selectionSet()
|
|
375
|
+
kind: "FragmentSpread",
|
|
376
|
+
name: nameNode(),
|
|
377
|
+
directives: directives(!1)
|
|
395
378
|
});
|
|
396
379
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
var v = arguments_(!1);
|
|
410
|
-
ignored();
|
|
411
|
-
var c = directives(!1);
|
|
412
|
-
var f = void 0;
|
|
413
|
-
if (123 === n.charCodeAt(i)) {
|
|
414
|
-
i++;
|
|
415
|
-
ignored();
|
|
416
|
-
f = selectionSet();
|
|
417
|
-
}
|
|
380
|
+
break;
|
|
381
|
+
|
|
382
|
+
case 123:
|
|
383
|
+
n++, ignored(), e.push({
|
|
384
|
+
kind: "InlineFragment",
|
|
385
|
+
typeCondition: void 0,
|
|
386
|
+
directives: void 0,
|
|
387
|
+
selectionSet: selectionSet()
|
|
388
|
+
});
|
|
389
|
+
break;
|
|
390
|
+
|
|
391
|
+
default:
|
|
418
392
|
e.push({
|
|
419
|
-
kind: "
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
value: u
|
|
423
|
-
} : void 0,
|
|
424
|
-
name: {
|
|
425
|
-
kind: "Name",
|
|
426
|
-
value: r
|
|
427
|
-
},
|
|
428
|
-
arguments: v,
|
|
429
|
-
directives: c,
|
|
430
|
-
selectionSet: f
|
|
393
|
+
kind: "FragmentSpread",
|
|
394
|
+
name: nameNode(),
|
|
395
|
+
directives: directives(!1)
|
|
431
396
|
});
|
|
432
397
|
}
|
|
433
398
|
} else {
|
|
434
|
-
|
|
399
|
+
var r = nameNode();
|
|
400
|
+
var t = void 0;
|
|
401
|
+
if (58 === i.charCodeAt(n)) {
|
|
402
|
+
n++, ignored(), t = r, r = nameNode();
|
|
403
|
+
}
|
|
404
|
+
var a = arguments_(!1);
|
|
405
|
+
var o = directives(!1);
|
|
406
|
+
var l = void 0;
|
|
407
|
+
if (123 === i.charCodeAt(n)) {
|
|
408
|
+
n++, ignored(), l = selectionSet();
|
|
409
|
+
}
|
|
410
|
+
e.push({
|
|
411
|
+
kind: "Field",
|
|
412
|
+
alias: t,
|
|
413
|
+
name: r,
|
|
414
|
+
arguments: a,
|
|
415
|
+
directives: o,
|
|
416
|
+
selectionSet: l
|
|
417
|
+
});
|
|
435
418
|
}
|
|
436
|
-
} while (125 !==
|
|
437
|
-
|
|
438
|
-
ignored();
|
|
439
|
-
return {
|
|
419
|
+
} while (125 !== i.charCodeAt(n));
|
|
420
|
+
return n++, ignored(), {
|
|
440
421
|
kind: "SelectionSet",
|
|
441
422
|
selections: e
|
|
442
423
|
};
|
|
443
424
|
}
|
|
444
425
|
|
|
445
|
-
function
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
426
|
+
function variableDefinitions() {
|
|
427
|
+
if (ignored(), 40 === i.charCodeAt(n)) {
|
|
428
|
+
var e = [];
|
|
429
|
+
n++, ignored();
|
|
430
|
+
do {
|
|
431
|
+
if (36 !== i.charCodeAt(n++)) {
|
|
432
|
+
throw error("Variable");
|
|
433
|
+
}
|
|
434
|
+
var r = nameNode();
|
|
435
|
+
if (58 !== i.charCodeAt(n++)) {
|
|
436
|
+
throw error("VariableDefinition");
|
|
437
|
+
}
|
|
438
|
+
ignored();
|
|
439
|
+
var t = type();
|
|
440
|
+
var a = void 0;
|
|
441
|
+
if (61 === i.charCodeAt(n)) {
|
|
442
|
+
n++, ignored(), a = value(!0);
|
|
443
|
+
}
|
|
444
|
+
ignored(), e.push({
|
|
445
|
+
kind: "VariableDefinition",
|
|
446
|
+
variable: {
|
|
447
|
+
kind: "Variable",
|
|
448
|
+
name: r
|
|
449
|
+
},
|
|
450
|
+
type: t,
|
|
451
|
+
defaultValue: a,
|
|
452
|
+
directives: directives(!0)
|
|
453
|
+
});
|
|
454
|
+
} while (41 !== i.charCodeAt(n));
|
|
455
|
+
return n++, ignored(), e;
|
|
458
456
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function fragmentDefinition() {
|
|
460
|
+
var e = nameNode();
|
|
461
|
+
if (111 !== i.charCodeAt(n++) || 110 !== i.charCodeAt(n++)) {
|
|
462
462
|
throw error("FragmentDefinition");
|
|
463
463
|
}
|
|
464
|
-
ignored()
|
|
465
|
-
return {
|
|
464
|
+
return ignored(), {
|
|
466
465
|
kind: "FragmentDefinition",
|
|
467
|
-
name:
|
|
468
|
-
kind: "Name",
|
|
469
|
-
value: e
|
|
470
|
-
},
|
|
466
|
+
name: e,
|
|
471
467
|
typeCondition: {
|
|
472
468
|
kind: "NamedType",
|
|
473
|
-
name:
|
|
474
|
-
kind: "Name",
|
|
475
|
-
value: r
|
|
476
|
-
}
|
|
469
|
+
name: nameNode()
|
|
477
470
|
},
|
|
478
|
-
directives:
|
|
479
|
-
selectionSet:
|
|
471
|
+
directives: directives(!1),
|
|
472
|
+
selectionSet: selectionSetStart()
|
|
480
473
|
};
|
|
481
474
|
}
|
|
482
475
|
|
|
483
|
-
var v = /(?:query|mutation|subscription|fragment)/y;
|
|
484
|
-
|
|
485
|
-
function operationDefinition(e) {
|
|
486
|
-
var r;
|
|
487
|
-
var t;
|
|
488
|
-
var l;
|
|
489
|
-
if (e) {
|
|
490
|
-
ignored();
|
|
491
|
-
r = advance(a);
|
|
492
|
-
t = function variableDefinitions() {
|
|
493
|
-
ignored();
|
|
494
|
-
if (40 === n.charCodeAt(i)) {
|
|
495
|
-
var e = [];
|
|
496
|
-
i++;
|
|
497
|
-
ignored();
|
|
498
|
-
var r;
|
|
499
|
-
do {
|
|
500
|
-
if (36 !== n.charCodeAt(i++)) {
|
|
501
|
-
throw error("Variable");
|
|
502
|
-
}
|
|
503
|
-
if (null == (r = advance(a))) {
|
|
504
|
-
throw error("Variable");
|
|
505
|
-
}
|
|
506
|
-
ignored();
|
|
507
|
-
if (58 !== n.charCodeAt(i++)) {
|
|
508
|
-
throw error("VariableDefinition");
|
|
509
|
-
}
|
|
510
|
-
ignored();
|
|
511
|
-
var t = type();
|
|
512
|
-
var l = void 0;
|
|
513
|
-
if (61 === n.charCodeAt(i)) {
|
|
514
|
-
i++;
|
|
515
|
-
ignored();
|
|
516
|
-
l = value(!0);
|
|
517
|
-
}
|
|
518
|
-
ignored();
|
|
519
|
-
e.push({
|
|
520
|
-
kind: "VariableDefinition",
|
|
521
|
-
variable: {
|
|
522
|
-
kind: "Variable",
|
|
523
|
-
name: {
|
|
524
|
-
kind: "Name",
|
|
525
|
-
value: r
|
|
526
|
-
}
|
|
527
|
-
},
|
|
528
|
-
type: t,
|
|
529
|
-
defaultValue: l,
|
|
530
|
-
directives: directives(!0)
|
|
531
|
-
});
|
|
532
|
-
} while (41 !== n.charCodeAt(i));
|
|
533
|
-
i++;
|
|
534
|
-
ignored();
|
|
535
|
-
return e;
|
|
536
|
-
}
|
|
537
|
-
}();
|
|
538
|
-
l = directives(!1);
|
|
539
|
-
}
|
|
540
|
-
if (123 === n.charCodeAt(i)) {
|
|
541
|
-
i++;
|
|
542
|
-
ignored();
|
|
543
|
-
return {
|
|
544
|
-
kind: "OperationDefinition",
|
|
545
|
-
operation: e || "query",
|
|
546
|
-
name: r ? {
|
|
547
|
-
kind: "Name",
|
|
548
|
-
value: r
|
|
549
|
-
} : void 0,
|
|
550
|
-
variableDefinitions: t,
|
|
551
|
-
directives: l,
|
|
552
|
-
selectionSet: selectionSet()
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
|
|
557
476
|
function parse(e, r) {
|
|
558
|
-
|
|
559
|
-
return function document(e, r) {
|
|
560
|
-
var n;
|
|
561
|
-
var t;
|
|
477
|
+
return n = 0, function document(e, r) {
|
|
562
478
|
ignored();
|
|
563
|
-
var
|
|
479
|
+
var i = [];
|
|
564
480
|
do {
|
|
565
|
-
if (
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
481
|
+
if (123 === e.charCodeAt(n)) {
|
|
482
|
+
i.push({
|
|
483
|
+
kind: "OperationDefinition",
|
|
484
|
+
operation: "query",
|
|
485
|
+
name: void 0,
|
|
486
|
+
variableDefinitions: void 0,
|
|
487
|
+
directives: void 0,
|
|
488
|
+
selectionSet: selectionSetStart()
|
|
489
|
+
});
|
|
570
490
|
} else {
|
|
571
|
-
|
|
491
|
+
var t = name();
|
|
492
|
+
switch (t) {
|
|
493
|
+
case "fragment":
|
|
494
|
+
i.push(fragmentDefinition());
|
|
495
|
+
break;
|
|
496
|
+
|
|
497
|
+
case "query":
|
|
498
|
+
case "mutation":
|
|
499
|
+
case "subscription":
|
|
500
|
+
var a;
|
|
501
|
+
var o = void 0;
|
|
502
|
+
if (40 !== (a = e.charCodeAt(n)) && 64 !== a && 123 !== a) {
|
|
503
|
+
o = nameNode();
|
|
504
|
+
}
|
|
505
|
+
i.push({
|
|
506
|
+
kind: "OperationDefinition",
|
|
507
|
+
operation: t,
|
|
508
|
+
name: o,
|
|
509
|
+
variableDefinitions: variableDefinitions(),
|
|
510
|
+
directives: directives(!1),
|
|
511
|
+
selectionSet: selectionSetStart()
|
|
512
|
+
});
|
|
513
|
+
break;
|
|
514
|
+
|
|
515
|
+
default:
|
|
516
|
+
throw error("Document");
|
|
517
|
+
}
|
|
572
518
|
}
|
|
573
|
-
} while (
|
|
519
|
+
} while (n < e.length);
|
|
574
520
|
if (!r) {
|
|
575
521
|
var l;
|
|
576
522
|
return {
|
|
577
523
|
kind: "Document",
|
|
578
|
-
definitions:
|
|
524
|
+
definitions: i,
|
|
579
525
|
set loc(e) {
|
|
580
526
|
l = e;
|
|
581
527
|
},
|
|
@@ -602,116 +548,102 @@ function parse(e, r) {
|
|
|
602
548
|
}
|
|
603
549
|
return {
|
|
604
550
|
kind: "Document",
|
|
605
|
-
definitions:
|
|
551
|
+
definitions: i
|
|
606
552
|
};
|
|
607
|
-
}(
|
|
553
|
+
}(i = e.body ? e.body : e, r && r.noLocation);
|
|
608
554
|
}
|
|
609
555
|
|
|
610
556
|
function parseValue(e, r) {
|
|
611
|
-
|
|
612
|
-
i = 0;
|
|
613
|
-
ignored();
|
|
614
|
-
return value(!1);
|
|
557
|
+
return i = e.body ? e.body : e, n = 0, ignored(), value(!1);
|
|
615
558
|
}
|
|
616
559
|
|
|
617
560
|
function parseType(e, r) {
|
|
618
|
-
|
|
619
|
-
i = 0;
|
|
620
|
-
return type();
|
|
561
|
+
return i = e.body ? e.body : e, n = 0, type();
|
|
621
562
|
}
|
|
622
563
|
|
|
623
|
-
var
|
|
564
|
+
var l = {};
|
|
624
565
|
|
|
625
566
|
function visit(e, r) {
|
|
626
|
-
var n = [];
|
|
627
567
|
var i = [];
|
|
568
|
+
var n = [];
|
|
628
569
|
try {
|
|
629
570
|
var t = function traverse(e, t, a) {
|
|
630
|
-
var
|
|
631
|
-
var
|
|
632
|
-
var u =
|
|
571
|
+
var o = !1;
|
|
572
|
+
var d = r[e.kind] && r[e.kind].enter || r[e.kind] || r.enter;
|
|
573
|
+
var u = d && d.call(r, e, t, a, n, i);
|
|
633
574
|
if (!1 === u) {
|
|
634
575
|
return e;
|
|
635
576
|
} else if (null === u) {
|
|
636
577
|
return null;
|
|
637
|
-
} else if (u ===
|
|
638
|
-
throw
|
|
578
|
+
} else if (u === l) {
|
|
579
|
+
throw l;
|
|
639
580
|
} else if (u && "string" == typeof u.kind) {
|
|
640
|
-
|
|
641
|
-
e = u;
|
|
581
|
+
o = u !== e, e = u;
|
|
642
582
|
}
|
|
643
583
|
if (a) {
|
|
644
|
-
|
|
584
|
+
i.push(a);
|
|
645
585
|
}
|
|
646
|
-
var
|
|
647
|
-
var
|
|
586
|
+
var s;
|
|
587
|
+
var c = {
|
|
648
588
|
...e
|
|
649
589
|
};
|
|
650
590
|
for (var v in e) {
|
|
651
|
-
|
|
591
|
+
n.push(v);
|
|
652
592
|
var f = e[v];
|
|
653
593
|
if (Array.isArray(f)) {
|
|
654
|
-
var
|
|
655
|
-
for (var
|
|
656
|
-
if (null != f[
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
d = traverse(f[m], m, f);
|
|
660
|
-
i.pop();
|
|
661
|
-
n.pop();
|
|
662
|
-
if (null == d) {
|
|
663
|
-
l = !0;
|
|
594
|
+
var m = [];
|
|
595
|
+
for (var h = 0; h < f.length; h++) {
|
|
596
|
+
if (null != f[h] && "string" == typeof f[h].kind) {
|
|
597
|
+
if (i.push(e), n.push(h), s = traverse(f[h], h, f), n.pop(), i.pop(), null == s) {
|
|
598
|
+
o = !0;
|
|
664
599
|
} else {
|
|
665
|
-
|
|
666
|
-
g.push(d);
|
|
600
|
+
o = o || s !== f[h], m.push(s);
|
|
667
601
|
}
|
|
668
602
|
}
|
|
669
603
|
}
|
|
670
|
-
f =
|
|
604
|
+
f = m;
|
|
671
605
|
} else if (null != f && "string" == typeof f.kind) {
|
|
672
|
-
if (void 0 !== (
|
|
673
|
-
|
|
674
|
-
f = d;
|
|
606
|
+
if (void 0 !== (s = traverse(f, v, e))) {
|
|
607
|
+
o = o || f !== s, f = s;
|
|
675
608
|
}
|
|
676
609
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
s[v] = f;
|
|
610
|
+
if (n.pop(), o) {
|
|
611
|
+
c[v] = f;
|
|
680
612
|
}
|
|
681
613
|
}
|
|
682
614
|
if (a) {
|
|
683
|
-
|
|
615
|
+
i.pop();
|
|
684
616
|
}
|
|
685
617
|
var p = r[e.kind] && r[e.kind].leave || r.leave;
|
|
686
|
-
var
|
|
687
|
-
if (
|
|
688
|
-
throw
|
|
689
|
-
} else if (void 0 !==
|
|
690
|
-
return
|
|
618
|
+
var g = p && p.call(r, e, t, a, n, i);
|
|
619
|
+
if (g === l) {
|
|
620
|
+
throw l;
|
|
621
|
+
} else if (void 0 !== g) {
|
|
622
|
+
return g;
|
|
691
623
|
} else if (void 0 !== u) {
|
|
692
|
-
return
|
|
624
|
+
return o ? c : u;
|
|
693
625
|
} else {
|
|
694
|
-
return
|
|
626
|
+
return o ? c : e;
|
|
695
627
|
}
|
|
696
628
|
}(e);
|
|
697
629
|
return void 0 !== t && !1 !== t ? t : e;
|
|
698
630
|
} catch (r) {
|
|
699
|
-
if (r !==
|
|
631
|
+
if (r !== l) {
|
|
700
632
|
throw r;
|
|
701
633
|
}
|
|
702
634
|
return e;
|
|
703
635
|
}
|
|
704
636
|
}
|
|
705
637
|
|
|
706
|
-
function mapJoin(e, r,
|
|
707
|
-
var
|
|
638
|
+
function mapJoin(e, r, i) {
|
|
639
|
+
var n = "";
|
|
708
640
|
for (var t = 0; t < e.length; t++) {
|
|
709
641
|
if (t) {
|
|
710
|
-
|
|
642
|
+
n += r;
|
|
711
643
|
}
|
|
712
|
-
|
|
644
|
+
n += i(e[t]);
|
|
713
645
|
}
|
|
714
|
-
return
|
|
646
|
+
return n;
|
|
715
647
|
}
|
|
716
648
|
|
|
717
649
|
function printString(e) {
|
|
@@ -722,9 +654,9 @@ function printBlockString(e) {
|
|
|
722
654
|
return '"""\n' + e.replace(/"""/g, '\\"""') + '\n"""';
|
|
723
655
|
}
|
|
724
656
|
|
|
725
|
-
var
|
|
657
|
+
var d = "\n";
|
|
726
658
|
|
|
727
|
-
var
|
|
659
|
+
var u = {
|
|
728
660
|
OperationDefinition(e) {
|
|
729
661
|
var r = e.operation;
|
|
730
662
|
if (e.name) {
|
|
@@ -734,44 +666,44 @@ var g = {
|
|
|
734
666
|
if (!e.name) {
|
|
735
667
|
r += " ";
|
|
736
668
|
}
|
|
737
|
-
r += "(" + mapJoin(e.variableDefinitions, ", ",
|
|
669
|
+
r += "(" + mapJoin(e.variableDefinitions, ", ", u.VariableDefinition) + ")";
|
|
738
670
|
}
|
|
739
671
|
if (e.directives && e.directives.length) {
|
|
740
|
-
r += " " + mapJoin(e.directives, " ",
|
|
672
|
+
r += " " + mapJoin(e.directives, " ", u.Directive);
|
|
741
673
|
}
|
|
742
|
-
return "query" !== r ? r + " " +
|
|
674
|
+
return "query" !== r ? r + " " + u.SelectionSet(e.selectionSet) : u.SelectionSet(e.selectionSet);
|
|
743
675
|
},
|
|
744
676
|
VariableDefinition(e) {
|
|
745
|
-
var r =
|
|
677
|
+
var r = u.Variable(e.variable) + ": " + _print(e.type);
|
|
746
678
|
if (e.defaultValue) {
|
|
747
679
|
r += " = " + _print(e.defaultValue);
|
|
748
680
|
}
|
|
749
681
|
if (e.directives && e.directives.length) {
|
|
750
|
-
r += " " + mapJoin(e.directives, " ",
|
|
682
|
+
r += " " + mapJoin(e.directives, " ", u.Directive);
|
|
751
683
|
}
|
|
752
684
|
return r;
|
|
753
685
|
},
|
|
754
686
|
Field(e) {
|
|
755
687
|
var r = e.alias ? e.alias.value + ": " + e.name.value : e.name.value;
|
|
756
688
|
if (e.arguments && e.arguments.length) {
|
|
757
|
-
var
|
|
758
|
-
if (r.length +
|
|
759
|
-
r += "(" + (
|
|
689
|
+
var i = mapJoin(e.arguments, ", ", u.Argument);
|
|
690
|
+
if (r.length + i.length + 2 > 80) {
|
|
691
|
+
r += "(" + (d += " ") + mapJoin(e.arguments, d, u.Argument) + (d = d.slice(0, -2)) + ")";
|
|
760
692
|
} else {
|
|
761
|
-
r += "(" +
|
|
693
|
+
r += "(" + i + ")";
|
|
762
694
|
}
|
|
763
695
|
}
|
|
764
696
|
if (e.directives && e.directives.length) {
|
|
765
|
-
r += " " + mapJoin(e.directives, " ",
|
|
697
|
+
r += " " + mapJoin(e.directives, " ", u.Directive);
|
|
766
698
|
}
|
|
767
699
|
if (e.selectionSet && e.selectionSet.selections.length) {
|
|
768
|
-
r += " " +
|
|
700
|
+
r += " " + u.SelectionSet(e.selectionSet);
|
|
769
701
|
}
|
|
770
702
|
return r;
|
|
771
703
|
},
|
|
772
704
|
StringValue(e) {
|
|
773
705
|
if (e.block) {
|
|
774
|
-
return printBlockString(e.value).replace(/\n/g,
|
|
706
|
+
return printBlockString(e.value).replace(/\n/g, d);
|
|
775
707
|
} else {
|
|
776
708
|
return printString(e.value);
|
|
777
709
|
}
|
|
@@ -784,20 +716,21 @@ var g = {
|
|
|
784
716
|
Name: e => e.value,
|
|
785
717
|
Variable: e => "$" + e.name.value,
|
|
786
718
|
ListValue: e => "[" + mapJoin(e.values, ", ", _print) + "]",
|
|
787
|
-
ObjectValue: e => "{" + mapJoin(e.fields, ", ",
|
|
719
|
+
ObjectValue: e => "{" + mapJoin(e.fields, ", ", u.ObjectField) + "}",
|
|
788
720
|
ObjectField: e => e.name.value + ": " + _print(e.value),
|
|
789
721
|
Document(e) {
|
|
790
722
|
if (!e.definitions || !e.definitions.length) {
|
|
791
723
|
return "";
|
|
724
|
+
} else {
|
|
725
|
+
return mapJoin(e.definitions, "\n\n", _print);
|
|
792
726
|
}
|
|
793
|
-
return mapJoin(e.definitions, "\n\n", _print);
|
|
794
727
|
},
|
|
795
|
-
SelectionSet: e => "{" + (
|
|
728
|
+
SelectionSet: e => "{" + (d += " ") + mapJoin(e.selections, d, _print) + (d = d.slice(0, -2)) + "}",
|
|
796
729
|
Argument: e => e.name.value + ": " + _print(e.value),
|
|
797
730
|
FragmentSpread(e) {
|
|
798
731
|
var r = "..." + e.name.value;
|
|
799
732
|
if (e.directives && e.directives.length) {
|
|
800
|
-
r += " " + mapJoin(e.directives, " ",
|
|
733
|
+
r += " " + mapJoin(e.directives, " ", u.Directive);
|
|
801
734
|
}
|
|
802
735
|
return r;
|
|
803
736
|
},
|
|
@@ -807,22 +740,21 @@ var g = {
|
|
|
807
740
|
r += " on " + e.typeCondition.name.value;
|
|
808
741
|
}
|
|
809
742
|
if (e.directives && e.directives.length) {
|
|
810
|
-
r += " " + mapJoin(e.directives, " ",
|
|
743
|
+
r += " " + mapJoin(e.directives, " ", u.Directive);
|
|
811
744
|
}
|
|
812
|
-
return r += " " +
|
|
745
|
+
return r += " " + u.SelectionSet(e.selectionSet);
|
|
813
746
|
},
|
|
814
747
|
FragmentDefinition(e) {
|
|
815
748
|
var r = "fragment " + e.name.value;
|
|
816
|
-
r += " on " + e.typeCondition.name.value
|
|
817
|
-
|
|
818
|
-
r += " " + mapJoin(e.directives, " ", g.Directive);
|
|
749
|
+
if (r += " on " + e.typeCondition.name.value, e.directives && e.directives.length) {
|
|
750
|
+
r += " " + mapJoin(e.directives, " ", u.Directive);
|
|
819
751
|
}
|
|
820
|
-
return r + " " +
|
|
752
|
+
return r + " " + u.SelectionSet(e.selectionSet);
|
|
821
753
|
},
|
|
822
754
|
Directive(e) {
|
|
823
755
|
var r = "@" + e.name.value;
|
|
824
756
|
if (e.arguments && e.arguments.length) {
|
|
825
|
-
r += "(" + mapJoin(e.arguments, ", ",
|
|
757
|
+
r += "(" + mapJoin(e.arguments, ", ", u.Argument) + ")";
|
|
826
758
|
}
|
|
827
759
|
return r;
|
|
828
760
|
},
|
|
@@ -831,11 +763,10 @@ var g = {
|
|
|
831
763
|
NonNullType: e => _print(e.type) + "!"
|
|
832
764
|
};
|
|
833
765
|
|
|
834
|
-
var _print = e =>
|
|
766
|
+
var _print = e => u[e.kind](e);
|
|
835
767
|
|
|
836
768
|
function print(e) {
|
|
837
|
-
|
|
838
|
-
return g[e.kind] ? g[e.kind](e) : "";
|
|
769
|
+
return d = "\n", u[e.kind] ? u[e.kind](e) : "";
|
|
839
770
|
}
|
|
840
771
|
|
|
841
772
|
function valueFromASTUntyped(e, r) {
|
|
@@ -855,17 +786,17 @@ function valueFromASTUntyped(e, r) {
|
|
|
855
786
|
return e.value;
|
|
856
787
|
|
|
857
788
|
case "ListValue":
|
|
858
|
-
var
|
|
859
|
-
for (var
|
|
860
|
-
|
|
789
|
+
var i = [];
|
|
790
|
+
for (var n = 0, t = e.values.length; n < t; n++) {
|
|
791
|
+
i.push(valueFromASTUntyped(e.values[n], r));
|
|
861
792
|
}
|
|
862
|
-
return
|
|
793
|
+
return i;
|
|
863
794
|
|
|
864
795
|
case "ObjectValue":
|
|
865
796
|
var a = Object.create(null);
|
|
866
|
-
for (var
|
|
867
|
-
var
|
|
868
|
-
a[
|
|
797
|
+
for (var o = 0, l = e.fields.length; o < l; o++) {
|
|
798
|
+
var d = e.fields[o];
|
|
799
|
+
a[d.name.value] = valueFromASTUntyped(d.value, r);
|
|
869
800
|
}
|
|
870
801
|
return a;
|
|
871
802
|
|
|
@@ -874,25 +805,25 @@ function valueFromASTUntyped(e, r) {
|
|
|
874
805
|
}
|
|
875
806
|
}
|
|
876
807
|
|
|
877
|
-
function valueFromTypeNode(e, r,
|
|
808
|
+
function valueFromTypeNode(e, r, i) {
|
|
878
809
|
if ("Variable" === e.kind) {
|
|
879
|
-
return
|
|
810
|
+
return i ? valueFromTypeNode(i[e.name.value], r, i) : void 0;
|
|
880
811
|
} else if ("NonNullType" === r.kind) {
|
|
881
|
-
return "NullValue" !== e.kind ? valueFromTypeNode(e, r,
|
|
812
|
+
return "NullValue" !== e.kind ? valueFromTypeNode(e, r, i) : void 0;
|
|
882
813
|
} else if ("NullValue" === e.kind) {
|
|
883
814
|
return null;
|
|
884
815
|
} else if ("ListType" === r.kind) {
|
|
885
816
|
if ("ListValue" === e.kind) {
|
|
886
|
-
var
|
|
817
|
+
var n = [];
|
|
887
818
|
for (var t = 0, a = e.values.length; t < a; t++) {
|
|
888
|
-
var
|
|
889
|
-
if (void 0 ===
|
|
819
|
+
var o = valueFromTypeNode(e.values[t], r.type, i);
|
|
820
|
+
if (void 0 === o) {
|
|
890
821
|
return;
|
|
891
822
|
} else {
|
|
892
|
-
|
|
823
|
+
n.push(o);
|
|
893
824
|
}
|
|
894
825
|
}
|
|
895
|
-
return
|
|
826
|
+
return n;
|
|
896
827
|
}
|
|
897
828
|
} else if ("NamedType" === r.kind) {
|
|
898
829
|
switch (r.name.value) {
|
|
@@ -900,10 +831,10 @@ function valueFromTypeNode(e, r, n) {
|
|
|
900
831
|
case "Float":
|
|
901
832
|
case "String":
|
|
902
833
|
case "Bool":
|
|
903
|
-
return r.name.value + "Value" === e.kind ? valueFromASTUntyped(e,
|
|
834
|
+
return r.name.value + "Value" === e.kind ? valueFromASTUntyped(e, i) : void 0;
|
|
904
835
|
|
|
905
836
|
default:
|
|
906
|
-
return valueFromASTUntyped(e,
|
|
837
|
+
return valueFromASTUntyped(e, i);
|
|
907
838
|
}
|
|
908
839
|
}
|
|
909
840
|
}
|
|
@@ -912,16 +843,16 @@ function isSelectionNode(e) {
|
|
|
912
843
|
return "Field" === e.kind || "FragmentSpread" === e.kind || "InlineFragment" === e.kind;
|
|
913
844
|
}
|
|
914
845
|
|
|
915
|
-
function Source(e, r,
|
|
846
|
+
function Source(e, r, i) {
|
|
916
847
|
return {
|
|
917
848
|
body: e,
|
|
918
849
|
name: r,
|
|
919
|
-
locationOffset:
|
|
850
|
+
locationOffset: i || {
|
|
920
851
|
line: 1,
|
|
921
852
|
column: 1
|
|
922
853
|
}
|
|
923
854
|
};
|
|
924
855
|
}
|
|
925
856
|
|
|
926
|
-
export {
|
|
857
|
+
export { l as BREAK, GraphQLError, e as Kind, r as OperationTypeNode, Source, isSelectionNode, parse, parseType, parseValue, print, printBlockString, printString, valueFromASTUntyped, valueFromTypeNode, visit };
|
|
927
858
|
//# sourceMappingURL=graphql.web.mjs.map
|