@graphql-tools/merge 8.1.2 → 8.1.3-alpha-881b29e4.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/es5/index.js DELETED
@@ -1,1084 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const tslib = require('tslib');
6
- const utils = require('@graphql-tools/utils/es5');
7
- const graphql = require('graphql');
8
-
9
- /**
10
- * Deep merges multiple resolver definition objects into a single definition.
11
- * @param resolversDefinitions Resolver definitions to be merged
12
- * @param options Additional options
13
- *
14
- * ```js
15
- * const { mergeResolvers } = require('@graphql-tools/merge/es5');
16
- * const clientResolver = require('./clientResolver');
17
- * const productResolver = require('./productResolver');
18
- *
19
- * const resolvers = mergeResolvers([
20
- * clientResolver,
21
- * productResolver,
22
- * ]);
23
- * ```
24
- *
25
- * If you don't want to manually create the array of resolver objects, you can
26
- * also use this function along with loadFiles:
27
- *
28
- * ```js
29
- * const path = require('path');
30
- * const { mergeResolvers } = require('@graphql-tools/merge/es5');
31
- * const { loadFilesSync } = require('@graphql-tools/load-files/es5');
32
- *
33
- * const resolversArray = loadFilesSync(path.join(__dirname, './resolvers'));
34
- *
35
- * const resolvers = mergeResolvers(resolversArray)
36
- * ```
37
- */
38
- function mergeResolvers(resolversDefinitions, options) {
39
- var e_1, _a, e_2, _b;
40
- if (!resolversDefinitions || (Array.isArray(resolversDefinitions) && resolversDefinitions.length === 0)) {
41
- return {};
42
- }
43
- if (!Array.isArray(resolversDefinitions)) {
44
- return resolversDefinitions;
45
- }
46
- if (resolversDefinitions.length === 1) {
47
- return resolversDefinitions[0] || {};
48
- }
49
- var resolvers = new Array();
50
- try {
51
- for (var resolversDefinitions_1 = tslib.__values(resolversDefinitions), resolversDefinitions_1_1 = resolversDefinitions_1.next(); !resolversDefinitions_1_1.done; resolversDefinitions_1_1 = resolversDefinitions_1.next()) {
52
- var resolversDefinition = resolversDefinitions_1_1.value;
53
- if (Array.isArray(resolversDefinition)) {
54
- resolversDefinition = mergeResolvers(resolversDefinition);
55
- }
56
- if (typeof resolversDefinition === 'object' && resolversDefinition) {
57
- resolvers.push(resolversDefinition);
58
- }
59
- }
60
- }
61
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
62
- finally {
63
- try {
64
- if (resolversDefinitions_1_1 && !resolversDefinitions_1_1.done && (_a = resolversDefinitions_1.return)) _a.call(resolversDefinitions_1);
65
- }
66
- finally { if (e_1) throw e_1.error; }
67
- }
68
- var result = utils.mergeDeep(resolvers, true);
69
- if (options === null || options === void 0 ? void 0 : options.exclusions) {
70
- try {
71
- for (var _c = tslib.__values(options.exclusions), _d = _c.next(); !_d.done; _d = _c.next()) {
72
- var exclusion = _d.value;
73
- var _e = tslib.__read(exclusion.split('.'), 2), typeName = _e[0], fieldName = _e[1];
74
- if (!fieldName || fieldName === '*') {
75
- delete result[typeName];
76
- }
77
- else if (result[typeName]) {
78
- delete result[typeName][fieldName];
79
- }
80
- }
81
- }
82
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
83
- finally {
84
- try {
85
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
86
- }
87
- finally { if (e_2) throw e_2.error; }
88
- }
89
- }
90
- return result;
91
- }
92
-
93
- function mergeArguments(args1, args2, config) {
94
- var result = deduplicateArguments(tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(args2), false), tslib.__read(args1), false).filter(utils.isSome));
95
- if (config && config.sort) {
96
- result.sort(utils.compareNodes);
97
- }
98
- return result;
99
- }
100
- function deduplicateArguments(args) {
101
- return args.reduce(function (acc, current) {
102
- var dup = acc.find(function (arg) { return arg.name.value === current.name.value; });
103
- if (!dup) {
104
- return acc.concat([current]);
105
- }
106
- return acc;
107
- }, []);
108
- }
109
-
110
- function directiveAlreadyExists(directivesArr, otherDirective) {
111
- return !!directivesArr.find(function (directive) { return directive.name.value === otherDirective.name.value; });
112
- }
113
- function nameAlreadyExists(name, namesArr) {
114
- return namesArr.some(function (_a) {
115
- var value = _a.value;
116
- return value === name.value;
117
- });
118
- }
119
- function mergeArguments$1(a1, a2) {
120
- var e_1, _a;
121
- var result = tslib.__spreadArray([], tslib.__read(a2), false);
122
- var _loop_1 = function (argument) {
123
- var existingIndex = result.findIndex(function (a) { return a.name.value === argument.name.value; });
124
- if (existingIndex > -1) {
125
- var existingArg = result[existingIndex];
126
- if (existingArg.value.kind === 'ListValue') {
127
- var source = existingArg.value.values;
128
- var target = argument.value.values;
129
- // merge values of two lists
130
- existingArg.value.values = deduplicateLists(source, target, function (targetVal, source) {
131
- var value = targetVal.value;
132
- return !value || !source.some(function (sourceVal) { return sourceVal.value === value; });
133
- });
134
- }
135
- else {
136
- existingArg.value = argument.value;
137
- }
138
- }
139
- else {
140
- result.push(argument);
141
- }
142
- };
143
- try {
144
- for (var a1_1 = tslib.__values(a1), a1_1_1 = a1_1.next(); !a1_1_1.done; a1_1_1 = a1_1.next()) {
145
- var argument = a1_1_1.value;
146
- _loop_1(argument);
147
- }
148
- }
149
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
150
- finally {
151
- try {
152
- if (a1_1_1 && !a1_1_1.done && (_a = a1_1.return)) _a.call(a1_1);
153
- }
154
- finally { if (e_1) throw e_1.error; }
155
- }
156
- return result;
157
- }
158
- function deduplicateDirectives(directives) {
159
- return directives
160
- .map(function (directive, i, all) {
161
- var firstAt = all.findIndex(function (d) { return d.name.value === directive.name.value; });
162
- if (firstAt !== i) {
163
- var dup = all[firstAt];
164
- directive.arguments = mergeArguments$1(directive.arguments, dup.arguments);
165
- return null;
166
- }
167
- return directive;
168
- })
169
- .filter(utils.isSome);
170
- }
171
- function mergeDirectives(d1, d2, config) {
172
- var e_2, _a;
173
- if (d1 === void 0) { d1 = []; }
174
- if (d2 === void 0) { d2 = []; }
175
- var reverseOrder = config && config.reverseDirectives;
176
- var asNext = reverseOrder ? d1 : d2;
177
- var asFirst = reverseOrder ? d2 : d1;
178
- var result = deduplicateDirectives(tslib.__spreadArray([], tslib.__read(asNext), false));
179
- var _loop_2 = function (directive) {
180
- if (directiveAlreadyExists(result, directive)) {
181
- var existingDirectiveIndex = result.findIndex(function (d) { return d.name.value === directive.name.value; });
182
- var existingDirective = result[existingDirectiveIndex];
183
- result[existingDirectiveIndex].arguments = mergeArguments$1(directive.arguments || [], existingDirective.arguments || []);
184
- }
185
- else {
186
- result.push(directive);
187
- }
188
- };
189
- try {
190
- for (var asFirst_1 = tslib.__values(asFirst), asFirst_1_1 = asFirst_1.next(); !asFirst_1_1.done; asFirst_1_1 = asFirst_1.next()) {
191
- var directive = asFirst_1_1.value;
192
- _loop_2(directive);
193
- }
194
- }
195
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
196
- finally {
197
- try {
198
- if (asFirst_1_1 && !asFirst_1_1.done && (_a = asFirst_1.return)) _a.call(asFirst_1);
199
- }
200
- finally { if (e_2) throw e_2.error; }
201
- }
202
- return result;
203
- }
204
- function validateInputs(node, existingNode) {
205
- var printedNode = graphql.print(tslib.__assign(tslib.__assign({}, node), { description: undefined }));
206
- var printedExistingNode = graphql.print(tslib.__assign(tslib.__assign({}, existingNode), { description: undefined }));
207
- // eslint-disable-next-line
208
- var leaveInputs = new RegExp('(directive @w*d*)|( on .*$)', 'g');
209
- var sameArguments = printedNode.replace(leaveInputs, '') === printedExistingNode.replace(leaveInputs, '');
210
- if (!sameArguments) {
211
- throw new Error("Unable to merge GraphQL directive \"" + node.name.value + "\". \nExisting directive: \n\t" + printedExistingNode + " \nReceived directive: \n\t" + printedNode);
212
- }
213
- }
214
- function mergeDirective(node, existingNode) {
215
- if (existingNode) {
216
- validateInputs(node, existingNode);
217
- return tslib.__assign(tslib.__assign({}, node), { locations: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(existingNode.locations), false), tslib.__read(node.locations.filter(function (name) { return !nameAlreadyExists(name, existingNode.locations); })), false) });
218
- }
219
- return node;
220
- }
221
- function deduplicateLists(source, target, filterFn) {
222
- return source.concat(target.filter(function (val) { return filterFn(val, source); }));
223
- }
224
-
225
- function mergeEnumValues(first, second, config) {
226
- var e_1, _a, e_2, _b;
227
- if (config === null || config === void 0 ? void 0 : config.consistentEnumMerge) {
228
- var reversed = [];
229
- if (first) {
230
- reversed.push.apply(reversed, tslib.__spreadArray([], tslib.__read(first), false));
231
- }
232
- first = second;
233
- second = reversed;
234
- }
235
- var enumValueMap = new Map();
236
- if (first) {
237
- try {
238
- for (var first_1 = tslib.__values(first), first_1_1 = first_1.next(); !first_1_1.done; first_1_1 = first_1.next()) {
239
- var firstValue = first_1_1.value;
240
- enumValueMap.set(firstValue.name.value, firstValue);
241
- }
242
- }
243
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
244
- finally {
245
- try {
246
- if (first_1_1 && !first_1_1.done && (_a = first_1.return)) _a.call(first_1);
247
- }
248
- finally { if (e_1) throw e_1.error; }
249
- }
250
- }
251
- if (second) {
252
- try {
253
- for (var second_1 = tslib.__values(second), second_1_1 = second_1.next(); !second_1_1.done; second_1_1 = second_1.next()) {
254
- var secondValue = second_1_1.value;
255
- var enumValue = secondValue.name.value;
256
- if (enumValueMap.has(enumValue)) {
257
- var firstValue = enumValueMap.get(enumValue);
258
- firstValue.description = secondValue.description || firstValue.description;
259
- firstValue.directives = mergeDirectives(secondValue.directives, firstValue.directives);
260
- }
261
- else {
262
- enumValueMap.set(enumValue, secondValue);
263
- }
264
- }
265
- }
266
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
267
- finally {
268
- try {
269
- if (second_1_1 && !second_1_1.done && (_b = second_1.return)) _b.call(second_1);
270
- }
271
- finally { if (e_2) throw e_2.error; }
272
- }
273
- }
274
- var result = tslib.__spreadArray([], tslib.__read(enumValueMap.values()), false);
275
- if (config && config.sort) {
276
- result.sort(utils.compareNodes);
277
- }
278
- return result;
279
- }
280
-
281
- function mergeEnum(e1, e2, config) {
282
- if (e2) {
283
- return {
284
- name: e1.name,
285
- description: e1['description'] || e2['description'],
286
- kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || e1.kind === 'EnumTypeDefinition' || e2.kind === 'EnumTypeDefinition'
287
- ? 'EnumTypeDefinition'
288
- : 'EnumTypeExtension',
289
- loc: e1.loc,
290
- directives: mergeDirectives(e1.directives, e2.directives, config),
291
- values: mergeEnumValues(e1.values, e2.values, config),
292
- };
293
- }
294
- return (config === null || config === void 0 ? void 0 : config.convertExtensions)
295
- ? tslib.__assign(tslib.__assign({}, e1), { kind: 'EnumTypeDefinition' }) : e1;
296
- }
297
-
298
- function isStringTypes(types) {
299
- return typeof types === 'string';
300
- }
301
- function isSourceTypes(types) {
302
- return types instanceof graphql.Source;
303
- }
304
- function extractType(type) {
305
- var visitedType = type;
306
- while (visitedType.kind === graphql.Kind.LIST_TYPE || visitedType.kind === 'NonNullType') {
307
- visitedType = visitedType.type;
308
- }
309
- return visitedType;
310
- }
311
- function isWrappingTypeNode(type) {
312
- return type.kind !== graphql.Kind.NAMED_TYPE;
313
- }
314
- function isListTypeNode(type) {
315
- return type.kind === graphql.Kind.LIST_TYPE;
316
- }
317
- function isNonNullTypeNode(type) {
318
- return type.kind === graphql.Kind.NON_NULL_TYPE;
319
- }
320
- function printTypeNode(type) {
321
- if (isListTypeNode(type)) {
322
- return "[" + printTypeNode(type.type) + "]";
323
- }
324
- if (isNonNullTypeNode(type)) {
325
- return printTypeNode(type.type) + "!";
326
- }
327
- return type.name.value;
328
- }
329
- (function (CompareVal) {
330
- CompareVal[CompareVal["A_SMALLER_THAN_B"] = -1] = "A_SMALLER_THAN_B";
331
- CompareVal[CompareVal["A_EQUALS_B"] = 0] = "A_EQUALS_B";
332
- CompareVal[CompareVal["A_GREATER_THAN_B"] = 1] = "A_GREATER_THAN_B";
333
- })(exports.CompareVal || (exports.CompareVal = {}));
334
- function defaultStringComparator(a, b) {
335
- if (a == null && b == null) {
336
- return exports.CompareVal.A_EQUALS_B;
337
- }
338
- if (a == null) {
339
- return exports.CompareVal.A_SMALLER_THAN_B;
340
- }
341
- if (b == null) {
342
- return exports.CompareVal.A_GREATER_THAN_B;
343
- }
344
- if (a < b)
345
- return exports.CompareVal.A_SMALLER_THAN_B;
346
- if (a > b)
347
- return exports.CompareVal.A_GREATER_THAN_B;
348
- return exports.CompareVal.A_EQUALS_B;
349
- }
350
-
351
- function fieldAlreadyExists(fieldsArr, otherField, config) {
352
- var result = fieldsArr.find(function (field) { return field.name.value === otherField.name.value; });
353
- if (result && !(config === null || config === void 0 ? void 0 : config.ignoreFieldConflicts)) {
354
- var t1 = extractType(result.type);
355
- var t2 = extractType(otherField.type);
356
- if (t1.name.value !== t2.name.value) {
357
- throw new Error("Field \"" + otherField.name.value + "\" already defined with a different type. Declared as \"" + t1.name.value + "\", but you tried to override with \"" + t2.name.value + "\"");
358
- }
359
- }
360
- return !!result;
361
- }
362
- function mergeFields(type, f1, f2, config) {
363
- var e_1, _a;
364
- var result = [];
365
- if (f2 != null) {
366
- result.push.apply(result, tslib.__spreadArray([], tslib.__read(f2), false));
367
- }
368
- if (f1 != null) {
369
- var _loop_1 = function (field) {
370
- if (fieldAlreadyExists(result, field, config)) {
371
- var existing = result.find(function (f) { return f.name.value === field.name.value; });
372
- if (!(config === null || config === void 0 ? void 0 : config.ignoreFieldConflicts)) {
373
- if (config === null || config === void 0 ? void 0 : config.throwOnConflict) {
374
- preventConflicts(type, existing, field);
375
- }
376
- else {
377
- preventConflicts(type, existing, field);
378
- }
379
- if (isNonNullTypeNode(field.type) && !isNonNullTypeNode(existing.type)) {
380
- existing.type = field.type;
381
- }
382
- }
383
- existing.arguments = mergeArguments(field['arguments'] || [], existing.arguments || [], config);
384
- existing.directives = mergeDirectives(field.directives, existing.directives, config);
385
- existing.description = field.description || existing.description;
386
- }
387
- else {
388
- result.push(field);
389
- }
390
- };
391
- try {
392
- for (var f1_1 = tslib.__values(f1), f1_1_1 = f1_1.next(); !f1_1_1.done; f1_1_1 = f1_1.next()) {
393
- var field = f1_1_1.value;
394
- _loop_1(field);
395
- }
396
- }
397
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
398
- finally {
399
- try {
400
- if (f1_1_1 && !f1_1_1.done && (_a = f1_1.return)) _a.call(f1_1);
401
- }
402
- finally { if (e_1) throw e_1.error; }
403
- }
404
- }
405
- if (config && config.sort) {
406
- result.sort(utils.compareNodes);
407
- }
408
- if (config && config.exclusions) {
409
- var exclusions_1 = config.exclusions;
410
- return result.filter(function (field) { return !exclusions_1.includes(type.name.value + "." + field.name.value); });
411
- }
412
- return result;
413
- }
414
- function preventConflicts(type, a, b, ignoreNullability) {
415
- var aType = printTypeNode(a.type);
416
- var bType = printTypeNode(b.type);
417
- if (aType !== bType && !safeChangeForFieldType(a.type, b.type)) {
418
- throw new Error("Field '" + type.name.value + "." + a.name.value + "' changed type from '" + aType + "' to '" + bType + "'");
419
- }
420
- }
421
- function safeChangeForFieldType(oldType, newType, ignoreNullability) {
422
- // both are named
423
- if (!isWrappingTypeNode(oldType) && !isWrappingTypeNode(newType)) {
424
- return oldType.toString() === newType.toString();
425
- }
426
- // new is non-null
427
- if (isNonNullTypeNode(newType)) {
428
- var ofType = isNonNullTypeNode(oldType) ? oldType.type : oldType;
429
- return safeChangeForFieldType(ofType, newType.type);
430
- }
431
- // old is non-null
432
- if (isNonNullTypeNode(oldType)) {
433
- return safeChangeForFieldType(newType, oldType);
434
- }
435
- // old is list
436
- if (isListTypeNode(oldType)) {
437
- return ((isListTypeNode(newType) && safeChangeForFieldType(oldType.type, newType.type)) ||
438
- (isNonNullTypeNode(newType) && safeChangeForFieldType(oldType, newType['type'])));
439
- }
440
- return false;
441
- }
442
-
443
- function mergeInputType(node, existingNode, config) {
444
- if (existingNode) {
445
- try {
446
- return {
447
- name: node.name,
448
- description: node['description'] || existingNode['description'],
449
- kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) ||
450
- node.kind === 'InputObjectTypeDefinition' ||
451
- existingNode.kind === 'InputObjectTypeDefinition'
452
- ? 'InputObjectTypeDefinition'
453
- : 'InputObjectTypeExtension',
454
- loc: node.loc,
455
- fields: mergeFields(node, node.fields, existingNode.fields, config),
456
- directives: mergeDirectives(node.directives, existingNode.directives, config),
457
- };
458
- }
459
- catch (e) {
460
- throw new Error("Unable to merge GraphQL input type \"" + node.name.value + "\": " + e.message);
461
- }
462
- }
463
- return (config === null || config === void 0 ? void 0 : config.convertExtensions)
464
- ? tslib.__assign(tslib.__assign({}, node), { kind: 'InputObjectTypeDefinition' }) : node;
465
- }
466
-
467
- function mergeInterface(node, existingNode, config) {
468
- if (existingNode) {
469
- try {
470
- return {
471
- name: node.name,
472
- description: node['description'] || existingNode['description'],
473
- kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) ||
474
- node.kind === 'InterfaceTypeDefinition' ||
475
- existingNode.kind === 'InterfaceTypeDefinition'
476
- ? 'InterfaceTypeDefinition'
477
- : 'InterfaceTypeExtension',
478
- loc: node.loc,
479
- fields: mergeFields(node, node.fields, existingNode.fields, config),
480
- directives: mergeDirectives(node.directives, existingNode.directives, config),
481
- };
482
- }
483
- catch (e) {
484
- throw new Error("Unable to merge GraphQL interface \"" + node.name.value + "\": " + e.message);
485
- }
486
- }
487
- return (config === null || config === void 0 ? void 0 : config.convertExtensions)
488
- ? tslib.__assign(tslib.__assign({}, node), { kind: 'InterfaceTypeDefinition' }) : node;
489
- }
490
-
491
- function alreadyExists(arr, other) {
492
- return !!arr.find(function (i) { return i.name.value === other.name.value; });
493
- }
494
- function mergeNamedTypeArray(first, second, config) {
495
- if (first === void 0) { first = []; }
496
- if (second === void 0) { second = []; }
497
- if (config === void 0) { config = {}; }
498
- var result = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(second), false), tslib.__read(first.filter(function (d) { return !alreadyExists(second, d); })), false);
499
- if (config && config.sort) {
500
- result.sort(utils.compareNodes);
501
- }
502
- return result;
503
- }
504
-
505
- function mergeType(node, existingNode, config) {
506
- if (existingNode) {
507
- try {
508
- return {
509
- name: node.name,
510
- description: node['description'] || existingNode['description'],
511
- kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) ||
512
- node.kind === 'ObjectTypeDefinition' ||
513
- existingNode.kind === 'ObjectTypeDefinition'
514
- ? 'ObjectTypeDefinition'
515
- : 'ObjectTypeExtension',
516
- loc: node.loc,
517
- fields: mergeFields(node, node.fields, existingNode.fields, config),
518
- directives: mergeDirectives(node.directives, existingNode.directives, config),
519
- interfaces: mergeNamedTypeArray(node.interfaces, existingNode.interfaces, config),
520
- };
521
- }
522
- catch (e) {
523
- throw new Error("Unable to merge GraphQL type \"" + node.name.value + "\": " + e.message);
524
- }
525
- }
526
- return (config === null || config === void 0 ? void 0 : config.convertExtensions)
527
- ? tslib.__assign(tslib.__assign({}, node), { kind: 'ObjectTypeDefinition' }) : node;
528
- }
529
-
530
- function mergeScalar(node, existingNode, config) {
531
- if (existingNode) {
532
- return {
533
- name: node.name,
534
- description: node['description'] || existingNode['description'],
535
- kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) ||
536
- node.kind === 'ScalarTypeDefinition' ||
537
- existingNode.kind === 'ScalarTypeDefinition'
538
- ? 'ScalarTypeDefinition'
539
- : 'ScalarTypeExtension',
540
- loc: node.loc,
541
- directives: mergeDirectives(node.directives, existingNode.directives, config),
542
- };
543
- }
544
- return (config === null || config === void 0 ? void 0 : config.convertExtensions)
545
- ? tslib.__assign(tslib.__assign({}, node), { kind: 'ScalarTypeDefinition' }) : node;
546
- }
547
-
548
- function mergeUnion(first, second, config) {
549
- if (second) {
550
- return {
551
- name: first.name,
552
- description: first['description'] || second['description'],
553
- // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility
554
- directives: mergeDirectives(first.directives, second.directives, config),
555
- kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || first.kind === 'UnionTypeDefinition' || second.kind === 'UnionTypeDefinition'
556
- ? 'UnionTypeDefinition'
557
- : 'UnionTypeExtension',
558
- loc: first.loc,
559
- types: mergeNamedTypeArray(first.types, second.types, config),
560
- };
561
- }
562
- return (config === null || config === void 0 ? void 0 : config.convertExtensions)
563
- ? tslib.__assign(tslib.__assign({}, first), { kind: 'UnionTypeDefinition' }) : first;
564
- }
565
-
566
- var DEFAULT_OPERATION_TYPE_NAME_MAP = {
567
- query: 'Query',
568
- mutation: 'Mutation',
569
- subscription: 'Subscription',
570
- };
571
- function mergeOperationTypes(opNodeList, existingOpNodeList) {
572
- if (opNodeList === void 0) { opNodeList = []; }
573
- if (existingOpNodeList === void 0) { existingOpNodeList = []; }
574
- var finalOpNodeList = [];
575
- var _loop_1 = function (opNodeType) {
576
- var opNode = opNodeList.find(function (n) { return n.operation === opNodeType; }) || existingOpNodeList.find(function (n) { return n.operation === opNodeType; });
577
- if (opNode) {
578
- finalOpNodeList.push(opNode);
579
- }
580
- };
581
- for (var opNodeType in DEFAULT_OPERATION_TYPE_NAME_MAP) {
582
- _loop_1(opNodeType);
583
- }
584
- return finalOpNodeList;
585
- }
586
- function mergeSchemaDefs(node, existingNode, config) {
587
- if (existingNode) {
588
- return {
589
- kind: node.kind === graphql.Kind.SCHEMA_DEFINITION || existingNode.kind === graphql.Kind.SCHEMA_DEFINITION
590
- ? graphql.Kind.SCHEMA_DEFINITION
591
- : graphql.Kind.SCHEMA_EXTENSION,
592
- description: node['description'] || existingNode['description'],
593
- directives: mergeDirectives(node.directives, existingNode.directives, config),
594
- operationTypes: mergeOperationTypes(node.operationTypes, existingNode.operationTypes),
595
- };
596
- }
597
- return ((config === null || config === void 0 ? void 0 : config.convertExtensions)
598
- ? tslib.__assign(tslib.__assign({}, node), { kind: graphql.Kind.SCHEMA_DEFINITION }) : node);
599
- }
600
-
601
- var schemaDefSymbol = 'SCHEMA_DEF_SYMBOL';
602
- function isNamedDefinitionNode(definitionNode) {
603
- return 'name' in definitionNode;
604
- }
605
- function mergeGraphQLNodes(nodes, config) {
606
- var e_1, _a;
607
- var _b, _c, _d;
608
- var mergedResultMap = {};
609
- try {
610
- for (var nodes_1 = tslib.__values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
611
- var nodeDefinition = nodes_1_1.value;
612
- if (isNamedDefinitionNode(nodeDefinition)) {
613
- var name_1 = (_b = nodeDefinition.name) === null || _b === void 0 ? void 0 : _b.value;
614
- if (config === null || config === void 0 ? void 0 : config.commentDescriptions) {
615
- utils.collectComment(nodeDefinition);
616
- }
617
- if (name_1 == null) {
618
- continue;
619
- }
620
- if (((_c = config === null || config === void 0 ? void 0 : config.exclusions) === null || _c === void 0 ? void 0 : _c.includes(name_1 + '.*')) || ((_d = config === null || config === void 0 ? void 0 : config.exclusions) === null || _d === void 0 ? void 0 : _d.includes(name_1))) {
621
- delete mergedResultMap[name_1];
622
- }
623
- else {
624
- switch (nodeDefinition.kind) {
625
- case graphql.Kind.OBJECT_TYPE_DEFINITION:
626
- case graphql.Kind.OBJECT_TYPE_EXTENSION:
627
- mergedResultMap[name_1] = mergeType(nodeDefinition, mergedResultMap[name_1], config);
628
- break;
629
- case graphql.Kind.ENUM_TYPE_DEFINITION:
630
- case graphql.Kind.ENUM_TYPE_EXTENSION:
631
- mergedResultMap[name_1] = mergeEnum(nodeDefinition, mergedResultMap[name_1], config);
632
- break;
633
- case graphql.Kind.UNION_TYPE_DEFINITION:
634
- case graphql.Kind.UNION_TYPE_EXTENSION:
635
- mergedResultMap[name_1] = mergeUnion(nodeDefinition, mergedResultMap[name_1], config);
636
- break;
637
- case graphql.Kind.SCALAR_TYPE_DEFINITION:
638
- case graphql.Kind.SCALAR_TYPE_EXTENSION:
639
- mergedResultMap[name_1] = mergeScalar(nodeDefinition, mergedResultMap[name_1], config);
640
- break;
641
- case graphql.Kind.INPUT_OBJECT_TYPE_DEFINITION:
642
- case graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION:
643
- mergedResultMap[name_1] = mergeInputType(nodeDefinition, mergedResultMap[name_1], config);
644
- break;
645
- case graphql.Kind.INTERFACE_TYPE_DEFINITION:
646
- case graphql.Kind.INTERFACE_TYPE_EXTENSION:
647
- mergedResultMap[name_1] = mergeInterface(nodeDefinition, mergedResultMap[name_1], config);
648
- break;
649
- case graphql.Kind.DIRECTIVE_DEFINITION:
650
- mergedResultMap[name_1] = mergeDirective(nodeDefinition, mergedResultMap[name_1]);
651
- break;
652
- }
653
- }
654
- }
655
- else if (nodeDefinition.kind === graphql.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === graphql.Kind.SCHEMA_EXTENSION) {
656
- mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol], config);
657
- }
658
- }
659
- }
660
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
661
- finally {
662
- try {
663
- if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
664
- }
665
- finally { if (e_1) throw e_1.error; }
666
- }
667
- return mergedResultMap;
668
- }
669
-
670
- function mergeTypeDefs(typeSource, config) {
671
- utils.resetComments();
672
- var doc = {
673
- kind: graphql.Kind.DOCUMENT,
674
- definitions: mergeGraphQLTypes(typeSource, tslib.__assign({ useSchemaDefinition: true, forceSchemaDefinition: false, throwOnConflict: false, commentDescriptions: false }, config)),
675
- };
676
- var result;
677
- if (config === null || config === void 0 ? void 0 : config.commentDescriptions) {
678
- result = utils.printWithComments(doc);
679
- }
680
- else {
681
- result = doc;
682
- }
683
- utils.resetComments();
684
- return result;
685
- }
686
- function visitTypeSources(typeSource, options, allNodes, visitedTypeSources) {
687
- var e_1, _a;
688
- if (allNodes === void 0) { allNodes = []; }
689
- if (visitedTypeSources === void 0) { visitedTypeSources = new Set(); }
690
- if (typeSource && !visitedTypeSources.has(typeSource)) {
691
- visitedTypeSources.add(typeSource);
692
- if (typeof typeSource === 'function') {
693
- visitTypeSources(typeSource(), options, allNodes, visitedTypeSources);
694
- }
695
- else if (Array.isArray(typeSource)) {
696
- try {
697
- for (var typeSource_1 = tslib.__values(typeSource), typeSource_1_1 = typeSource_1.next(); !typeSource_1_1.done; typeSource_1_1 = typeSource_1.next()) {
698
- var type = typeSource_1_1.value;
699
- visitTypeSources(type, options, allNodes, visitedTypeSources);
700
- }
701
- }
702
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
703
- finally {
704
- try {
705
- if (typeSource_1_1 && !typeSource_1_1.done && (_a = typeSource_1.return)) _a.call(typeSource_1);
706
- }
707
- finally { if (e_1) throw e_1.error; }
708
- }
709
- }
710
- else if (graphql.isSchema(typeSource)) {
711
- var documentNode = utils.getDocumentNodeFromSchema(typeSource, options);
712
- visitTypeSources(documentNode.definitions, options, allNodes, visitedTypeSources);
713
- }
714
- else if (isStringTypes(typeSource) || isSourceTypes(typeSource)) {
715
- var documentNode = graphql.parse(typeSource, options);
716
- visitTypeSources(documentNode.definitions, options, allNodes, visitedTypeSources);
717
- }
718
- else if (typeof typeSource === 'object' && graphql.isDefinitionNode(typeSource)) {
719
- allNodes.push(typeSource);
720
- }
721
- else if (utils.isDocumentNode(typeSource)) {
722
- visitTypeSources(typeSource.definitions, options, allNodes, visitedTypeSources);
723
- }
724
- else {
725
- throw new Error("typeDefs must contain only strings, documents, schemas, or functions, got " + typeof typeSource);
726
- }
727
- }
728
- return allNodes;
729
- }
730
- function mergeGraphQLTypes(typeSource, config) {
731
- var _a, _b, _c;
732
- utils.resetComments();
733
- var allNodes = visitTypeSources(typeSource, config);
734
- var mergedNodes = mergeGraphQLNodes(allNodes, config);
735
- if (config === null || config === void 0 ? void 0 : config.useSchemaDefinition) {
736
- // XXX: right now we don't handle multiple schema definitions
737
- var schemaDef = mergedNodes[schemaDefSymbol] || {
738
- kind: graphql.Kind.SCHEMA_DEFINITION,
739
- operationTypes: [],
740
- };
741
- var operationTypes = schemaDef.operationTypes;
742
- var _loop_1 = function (opTypeDefNodeType) {
743
- var opTypeDefNode = operationTypes.find(function (operationType) { return operationType.operation === opTypeDefNodeType; });
744
- if (!opTypeDefNode) {
745
- var possibleRootTypeName = DEFAULT_OPERATION_TYPE_NAME_MAP[opTypeDefNodeType];
746
- var existingPossibleRootType = mergedNodes[possibleRootTypeName];
747
- if (existingPossibleRootType != null && existingPossibleRootType.name != null) {
748
- operationTypes.push({
749
- kind: graphql.Kind.OPERATION_TYPE_DEFINITION,
750
- type: {
751
- kind: graphql.Kind.NAMED_TYPE,
752
- name: existingPossibleRootType.name,
753
- },
754
- operation: opTypeDefNodeType,
755
- });
756
- }
757
- }
758
- };
759
- for (var opTypeDefNodeType in DEFAULT_OPERATION_TYPE_NAME_MAP) {
760
- _loop_1(opTypeDefNodeType);
761
- }
762
- if (((_a = schemaDef === null || schemaDef === void 0 ? void 0 : schemaDef.operationTypes) === null || _a === void 0 ? void 0 : _a.length) != null && schemaDef.operationTypes.length > 0) {
763
- mergedNodes[schemaDefSymbol] = schemaDef;
764
- }
765
- }
766
- if ((config === null || config === void 0 ? void 0 : config.forceSchemaDefinition) && !((_c = (_b = mergedNodes[schemaDefSymbol]) === null || _b === void 0 ? void 0 : _b.operationTypes) === null || _c === void 0 ? void 0 : _c.length)) {
767
- mergedNodes[schemaDefSymbol] = {
768
- kind: graphql.Kind.SCHEMA_DEFINITION,
769
- operationTypes: [
770
- {
771
- kind: graphql.Kind.OPERATION_TYPE_DEFINITION,
772
- operation: 'query',
773
- type: {
774
- kind: graphql.Kind.NAMED_TYPE,
775
- name: {
776
- kind: graphql.Kind.NAME,
777
- value: 'Query',
778
- },
779
- },
780
- },
781
- ],
782
- };
783
- }
784
- var mergedNodeDefinitions = Object.values(mergedNodes);
785
- if (config === null || config === void 0 ? void 0 : config.sort) {
786
- var sortFn_1 = typeof config.sort === 'function' ? config.sort : defaultStringComparator;
787
- mergedNodeDefinitions.sort(function (a, b) { var _a, _b; return sortFn_1((_a = a.name) === null || _a === void 0 ? void 0 : _a.value, (_b = b.name) === null || _b === void 0 ? void 0 : _b.value); });
788
- }
789
- return mergedNodeDefinitions;
790
- }
791
-
792
- function travelSchemaPossibleExtensions(schema, hooks) {
793
- var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f, e_7, _g;
794
- hooks.onSchema(schema);
795
- var typesMap = schema.getTypeMap();
796
- try {
797
- for (var _h = tslib.__values(Object.entries(typesMap)), _j = _h.next(); !_j.done; _j = _h.next()) {
798
- var _k = tslib.__read(_j.value, 2), type = _k[1];
799
- var isPredefinedScalar = graphql.isScalarType(type) && graphql.isSpecifiedScalarType(type);
800
- var isIntrospection = graphql.isIntrospectionType(type);
801
- if (isPredefinedScalar || isIntrospection) {
802
- continue;
803
- }
804
- if (graphql.isObjectType(type)) {
805
- hooks.onObjectType(type);
806
- var fields = type.getFields();
807
- try {
808
- for (var _l = (e_2 = void 0, tslib.__values(Object.entries(fields))), _m = _l.next(); !_m.done; _m = _l.next()) {
809
- var _o = tslib.__read(_m.value, 2), field = _o[1];
810
- hooks.onObjectField(type, field);
811
- var args = field.args || [];
812
- try {
813
- for (var args_1 = (e_3 = void 0, tslib.__values(args)), args_1_1 = args_1.next(); !args_1_1.done; args_1_1 = args_1.next()) {
814
- var arg = args_1_1.value;
815
- hooks.onObjectFieldArg(type, field, arg);
816
- }
817
- }
818
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
819
- finally {
820
- try {
821
- if (args_1_1 && !args_1_1.done && (_c = args_1.return)) _c.call(args_1);
822
- }
823
- finally { if (e_3) throw e_3.error; }
824
- }
825
- }
826
- }
827
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
828
- finally {
829
- try {
830
- if (_m && !_m.done && (_b = _l.return)) _b.call(_l);
831
- }
832
- finally { if (e_2) throw e_2.error; }
833
- }
834
- }
835
- else if (graphql.isInterfaceType(type)) {
836
- hooks.onInterface(type);
837
- var fields = type.getFields();
838
- try {
839
- for (var _p = (e_4 = void 0, tslib.__values(Object.entries(fields))), _q = _p.next(); !_q.done; _q = _p.next()) {
840
- var _r = tslib.__read(_q.value, 2), field = _r[1];
841
- hooks.onInterfaceField(type, field);
842
- var args = field.args || [];
843
- try {
844
- for (var args_2 = (e_5 = void 0, tslib.__values(args)), args_2_1 = args_2.next(); !args_2_1.done; args_2_1 = args_2.next()) {
845
- var arg = args_2_1.value;
846
- hooks.onInterfaceFieldArg(type, field, arg);
847
- }
848
- }
849
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
850
- finally {
851
- try {
852
- if (args_2_1 && !args_2_1.done && (_e = args_2.return)) _e.call(args_2);
853
- }
854
- finally { if (e_5) throw e_5.error; }
855
- }
856
- }
857
- }
858
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
859
- finally {
860
- try {
861
- if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
862
- }
863
- finally { if (e_4) throw e_4.error; }
864
- }
865
- }
866
- else if (graphql.isInputObjectType(type)) {
867
- hooks.onInputType(type);
868
- var fields = type.getFields();
869
- try {
870
- for (var _s = (e_6 = void 0, tslib.__values(Object.entries(fields))), _t = _s.next(); !_t.done; _t = _s.next()) {
871
- var _u = tslib.__read(_t.value, 2), field = _u[1];
872
- hooks.onInputFieldType(type, field);
873
- }
874
- }
875
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
876
- finally {
877
- try {
878
- if (_t && !_t.done && (_f = _s.return)) _f.call(_s);
879
- }
880
- finally { if (e_6) throw e_6.error; }
881
- }
882
- }
883
- else if (graphql.isUnionType(type)) {
884
- hooks.onUnion(type);
885
- }
886
- else if (graphql.isScalarType(type)) {
887
- hooks.onScalar(type);
888
- }
889
- else if (graphql.isEnumType(type)) {
890
- hooks.onEnum(type);
891
- try {
892
- for (var _v = (e_7 = void 0, tslib.__values(type.getValues())), _w = _v.next(); !_w.done; _w = _v.next()) {
893
- var value = _w.value;
894
- hooks.onEnumValue(type, value);
895
- }
896
- }
897
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
898
- finally {
899
- try {
900
- if (_w && !_w.done && (_g = _v.return)) _g.call(_v);
901
- }
902
- finally { if (e_7) throw e_7.error; }
903
- }
904
- }
905
- }
906
- }
907
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
908
- finally {
909
- try {
910
- if (_j && !_j.done && (_a = _h.return)) _a.call(_h);
911
- }
912
- finally { if (e_1) throw e_1.error; }
913
- }
914
- }
915
- function mergeExtensions(extensions) {
916
- return utils.mergeDeep(extensions);
917
- }
918
- function applyExtensionObject(obj, extensions) {
919
- if (!obj) {
920
- return;
921
- }
922
- obj.extensions = utils.mergeDeep([obj.extensions || {}, extensions || {}]);
923
- }
924
- function applyExtensions(schema, extensions) {
925
- var e_8, _a, e_9, _b, e_10, _c, e_11, _d, e_12, _e;
926
- applyExtensionObject(schema, extensions.schemaExtensions);
927
- try {
928
- for (var _f = tslib.__values(Object.entries(extensions.types || {})), _g = _f.next(); !_g.done; _g = _f.next()) {
929
- var _h = tslib.__read(_g.value, 2), typeName = _h[0], data = _h[1];
930
- var type = schema.getType(typeName);
931
- if (type) {
932
- applyExtensionObject(type, data.extensions);
933
- if (data.type === 'object' || data.type === 'interface') {
934
- try {
935
- for (var _j = (e_9 = void 0, tslib.__values(Object.entries(data.fields))), _k = _j.next(); !_k.done; _k = _j.next()) {
936
- var _l = tslib.__read(_k.value, 2), fieldName = _l[0], fieldData = _l[1];
937
- var field = type.getFields()[fieldName];
938
- if (field) {
939
- applyExtensionObject(field, fieldData.extensions);
940
- var _loop_1 = function (arg, argData) {
941
- applyExtensionObject(field.args.find(function (a) { return a.name === arg; }), argData);
942
- };
943
- try {
944
- for (var _m = (e_10 = void 0, tslib.__values(Object.entries(fieldData.arguments))), _o = _m.next(); !_o.done; _o = _m.next()) {
945
- var _p = tslib.__read(_o.value, 2), arg = _p[0], argData = _p[1];
946
- _loop_1(arg, argData);
947
- }
948
- }
949
- catch (e_10_1) { e_10 = { error: e_10_1 }; }
950
- finally {
951
- try {
952
- if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
953
- }
954
- finally { if (e_10) throw e_10.error; }
955
- }
956
- }
957
- }
958
- }
959
- catch (e_9_1) { e_9 = { error: e_9_1 }; }
960
- finally {
961
- try {
962
- if (_k && !_k.done && (_b = _j.return)) _b.call(_j);
963
- }
964
- finally { if (e_9) throw e_9.error; }
965
- }
966
- }
967
- else if (data.type === 'input') {
968
- try {
969
- for (var _q = (e_11 = void 0, tslib.__values(Object.entries(data.fields))), _r = _q.next(); !_r.done; _r = _q.next()) {
970
- var _s = tslib.__read(_r.value, 2), fieldName = _s[0], fieldData = _s[1];
971
- var field = type.getFields()[fieldName];
972
- applyExtensionObject(field, fieldData.extensions);
973
- }
974
- }
975
- catch (e_11_1) { e_11 = { error: e_11_1 }; }
976
- finally {
977
- try {
978
- if (_r && !_r.done && (_d = _q.return)) _d.call(_q);
979
- }
980
- finally { if (e_11) throw e_11.error; }
981
- }
982
- }
983
- else if (data.type === 'enum') {
984
- try {
985
- for (var _t = (e_12 = void 0, tslib.__values(Object.entries(data.values))), _u = _t.next(); !_u.done; _u = _t.next()) {
986
- var _v = tslib.__read(_u.value, 2), valueName = _v[0], valueData = _v[1];
987
- var value = type.getValue(valueName);
988
- applyExtensionObject(value, valueData);
989
- }
990
- }
991
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
992
- finally {
993
- try {
994
- if (_u && !_u.done && (_e = _t.return)) _e.call(_t);
995
- }
996
- finally { if (e_12) throw e_12.error; }
997
- }
998
- }
999
- }
1000
- }
1001
- }
1002
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
1003
- finally {
1004
- try {
1005
- if (_g && !_g.done && (_a = _f.return)) _a.call(_f);
1006
- }
1007
- finally { if (e_8) throw e_8.error; }
1008
- }
1009
- return schema;
1010
- }
1011
- function extractExtensionsFromSchema(schema) {
1012
- var result = {
1013
- schemaExtensions: {},
1014
- types: {},
1015
- };
1016
- travelSchemaPossibleExtensions(schema, {
1017
- onSchema: function (schema) { return (result.schemaExtensions = schema.extensions || {}); },
1018
- onObjectType: function (type) { return (result.types[type.name] = { fields: {}, type: 'object', extensions: type.extensions || {} }); },
1019
- onObjectField: function (type, field) {
1020
- return (result.types[type.name].fields[field.name] = {
1021
- arguments: {},
1022
- extensions: field.extensions || {},
1023
- });
1024
- },
1025
- onObjectFieldArg: function (type, field, arg) {
1026
- return (result.types[type.name].fields[field.name].arguments[arg.name] = arg.extensions || {});
1027
- },
1028
- onInterface: function (type) {
1029
- return (result.types[type.name] = { fields: {}, type: 'interface', extensions: type.extensions || {} });
1030
- },
1031
- onInterfaceField: function (type, field) {
1032
- return (result.types[type.name].fields[field.name] = {
1033
- arguments: {},
1034
- extensions: field.extensions || {},
1035
- });
1036
- },
1037
- onInterfaceFieldArg: function (type, field, arg) {
1038
- return (result.types[type.name].fields[field.name].arguments[arg.name] =
1039
- arg.extensions || {});
1040
- },
1041
- onEnum: function (type) { return (result.types[type.name] = { values: {}, type: 'enum', extensions: type.extensions || {} }); },
1042
- onEnumValue: function (type, value) {
1043
- return (result.types[type.name].values[value.name] = value.extensions || {});
1044
- },
1045
- onScalar: function (type) { return (result.types[type.name] = { type: 'scalar', extensions: type.extensions || {} }); },
1046
- onUnion: function (type) { return (result.types[type.name] = { type: 'union', extensions: type.extensions || {} }); },
1047
- onInputType: function (type) { return (result.types[type.name] = { fields: {}, type: 'input', extensions: type.extensions || {} }); },
1048
- onInputFieldType: function (type, field) {
1049
- return (result.types[type.name].fields[field.name] = { extensions: field.extensions || {} });
1050
- },
1051
- });
1052
- return result;
1053
- }
1054
-
1055
- exports.applyExtensions = applyExtensions;
1056
- exports.defaultStringComparator = defaultStringComparator;
1057
- exports.extractExtensionsFromSchema = extractExtensionsFromSchema;
1058
- exports.extractType = extractType;
1059
- exports.isListTypeNode = isListTypeNode;
1060
- exports.isNamedDefinitionNode = isNamedDefinitionNode;
1061
- exports.isNonNullTypeNode = isNonNullTypeNode;
1062
- exports.isSourceTypes = isSourceTypes;
1063
- exports.isStringTypes = isStringTypes;
1064
- exports.isWrappingTypeNode = isWrappingTypeNode;
1065
- exports.mergeArguments = mergeArguments;
1066
- exports.mergeDirective = mergeDirective;
1067
- exports.mergeDirectives = mergeDirectives;
1068
- exports.mergeEnum = mergeEnum;
1069
- exports.mergeEnumValues = mergeEnumValues;
1070
- exports.mergeExtensions = mergeExtensions;
1071
- exports.mergeFields = mergeFields;
1072
- exports.mergeGraphQLNodes = mergeGraphQLNodes;
1073
- exports.mergeGraphQLTypes = mergeGraphQLTypes;
1074
- exports.mergeInputType = mergeInputType;
1075
- exports.mergeInterface = mergeInterface;
1076
- exports.mergeNamedTypeArray = mergeNamedTypeArray;
1077
- exports.mergeResolvers = mergeResolvers;
1078
- exports.mergeScalar = mergeScalar;
1079
- exports.mergeType = mergeType;
1080
- exports.mergeTypeDefs = mergeTypeDefs;
1081
- exports.mergeUnion = mergeUnion;
1082
- exports.printTypeNode = printTypeNode;
1083
- exports.schemaDefSymbol = schemaDefSymbol;
1084
- exports.travelSchemaPossibleExtensions = travelSchemaPossibleExtensions;