@graphql-tools/merge 8.1.3-alpha-be1b2ebd.0 → 8.2.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 +1 -1
- package/index.js +8 -8
- package/index.mjs +9 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Check API Reference for more information about this package;
|
|
2
|
-
https://www.graphql-tools.com/docs/api/modules/
|
|
2
|
+
https://www.graphql-tools.com/docs/api/modules/merge_src
|
|
3
3
|
|
|
4
4
|
You can also learn more about Schema Merging in this chapter;
|
|
5
5
|
https://www.graphql-tools.com/docs/schema-merging
|
package/index.js
CHANGED
|
@@ -230,7 +230,7 @@ function mergeEnum(e1, e2, config) {
|
|
|
230
230
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
231
231
|
? {
|
|
232
232
|
...e1,
|
|
233
|
-
kind:
|
|
233
|
+
kind: graphql.Kind.ENUM_TYPE_DEFINITION,
|
|
234
234
|
}
|
|
235
235
|
: e1;
|
|
236
236
|
}
|
|
@@ -389,7 +389,7 @@ function mergeInputType(node, existingNode, config) {
|
|
|
389
389
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
390
390
|
? {
|
|
391
391
|
...node,
|
|
392
|
-
kind:
|
|
392
|
+
kind: graphql.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
393
393
|
}
|
|
394
394
|
: node;
|
|
395
395
|
}
|
|
@@ -417,7 +417,7 @@ function mergeInterface(node, existingNode, config) {
|
|
|
417
417
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
418
418
|
? {
|
|
419
419
|
...node,
|
|
420
|
-
kind:
|
|
420
|
+
kind: graphql.Kind.INTERFACE_TYPE_DEFINITION,
|
|
421
421
|
}
|
|
422
422
|
: node;
|
|
423
423
|
}
|
|
@@ -457,7 +457,7 @@ function mergeType(node, existingNode, config) {
|
|
|
457
457
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
458
458
|
? {
|
|
459
459
|
...node,
|
|
460
|
-
kind:
|
|
460
|
+
kind: graphql.Kind.OBJECT_TYPE_DEFINITION,
|
|
461
461
|
}
|
|
462
462
|
: node;
|
|
463
463
|
}
|
|
@@ -479,7 +479,7 @@ function mergeScalar(node, existingNode, config) {
|
|
|
479
479
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
480
480
|
? {
|
|
481
481
|
...node,
|
|
482
|
-
kind:
|
|
482
|
+
kind: graphql.Kind.SCALAR_TYPE_DEFINITION,
|
|
483
483
|
}
|
|
484
484
|
: node;
|
|
485
485
|
}
|
|
@@ -492,8 +492,8 @@ function mergeUnion(first, second, config) {
|
|
|
492
492
|
// ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility
|
|
493
493
|
directives: mergeDirectives(first.directives, second.directives, config),
|
|
494
494
|
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || first.kind === 'UnionTypeDefinition' || second.kind === 'UnionTypeDefinition'
|
|
495
|
-
?
|
|
496
|
-
:
|
|
495
|
+
? graphql.Kind.UNION_TYPE_DEFINITION
|
|
496
|
+
: graphql.Kind.UNION_TYPE_EXTENSION,
|
|
497
497
|
loc: first.loc,
|
|
498
498
|
types: mergeNamedTypeArray(first.types, second.types, config),
|
|
499
499
|
};
|
|
@@ -501,7 +501,7 @@ function mergeUnion(first, second, config) {
|
|
|
501
501
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
502
502
|
? {
|
|
503
503
|
...first,
|
|
504
|
-
kind:
|
|
504
|
+
kind: graphql.Kind.UNION_TYPE_DEFINITION,
|
|
505
505
|
}
|
|
506
506
|
: first;
|
|
507
507
|
}
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mergeDeep, isSome, compareNodes, collectComment, resetComments, printWithComments, getDocumentNodeFromSchema, isDocumentNode } from '@graphql-tools/utils';
|
|
2
|
-
import { print,
|
|
2
|
+
import { print, Kind, Source, isSchema, parse, isDefinitionNode, isScalarType, isSpecifiedScalarType, isIntrospectionType, isObjectType, isInterfaceType, isInputObjectType, isUnionType, isEnumType } from 'graphql';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Deep merges multiple resolver definition objects into a single definition.
|
|
@@ -226,7 +226,7 @@ function mergeEnum(e1, e2, config) {
|
|
|
226
226
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
227
227
|
? {
|
|
228
228
|
...e1,
|
|
229
|
-
kind:
|
|
229
|
+
kind: Kind.ENUM_TYPE_DEFINITION,
|
|
230
230
|
}
|
|
231
231
|
: e1;
|
|
232
232
|
}
|
|
@@ -386,7 +386,7 @@ function mergeInputType(node, existingNode, config) {
|
|
|
386
386
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
387
387
|
? {
|
|
388
388
|
...node,
|
|
389
|
-
kind:
|
|
389
|
+
kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
390
390
|
}
|
|
391
391
|
: node;
|
|
392
392
|
}
|
|
@@ -414,7 +414,7 @@ function mergeInterface(node, existingNode, config) {
|
|
|
414
414
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
415
415
|
? {
|
|
416
416
|
...node,
|
|
417
|
-
kind:
|
|
417
|
+
kind: Kind.INTERFACE_TYPE_DEFINITION,
|
|
418
418
|
}
|
|
419
419
|
: node;
|
|
420
420
|
}
|
|
@@ -454,7 +454,7 @@ function mergeType(node, existingNode, config) {
|
|
|
454
454
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
455
455
|
? {
|
|
456
456
|
...node,
|
|
457
|
-
kind:
|
|
457
|
+
kind: Kind.OBJECT_TYPE_DEFINITION,
|
|
458
458
|
}
|
|
459
459
|
: node;
|
|
460
460
|
}
|
|
@@ -476,7 +476,7 @@ function mergeScalar(node, existingNode, config) {
|
|
|
476
476
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
477
477
|
? {
|
|
478
478
|
...node,
|
|
479
|
-
kind:
|
|
479
|
+
kind: Kind.SCALAR_TYPE_DEFINITION,
|
|
480
480
|
}
|
|
481
481
|
: node;
|
|
482
482
|
}
|
|
@@ -489,8 +489,8 @@ function mergeUnion(first, second, config) {
|
|
|
489
489
|
// ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility
|
|
490
490
|
directives: mergeDirectives(first.directives, second.directives, config),
|
|
491
491
|
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || first.kind === 'UnionTypeDefinition' || second.kind === 'UnionTypeDefinition'
|
|
492
|
-
?
|
|
493
|
-
:
|
|
492
|
+
? Kind.UNION_TYPE_DEFINITION
|
|
493
|
+
: Kind.UNION_TYPE_EXTENSION,
|
|
494
494
|
loc: first.loc,
|
|
495
495
|
types: mergeNamedTypeArray(first.types, second.types, config),
|
|
496
496
|
};
|
|
@@ -498,7 +498,7 @@ function mergeUnion(first, second, config) {
|
|
|
498
498
|
return (config === null || config === void 0 ? void 0 : config.convertExtensions)
|
|
499
499
|
? {
|
|
500
500
|
...first,
|
|
501
|
-
kind:
|
|
501
|
+
kind: Kind.UNION_TYPE_DEFINITION,
|
|
502
502
|
}
|
|
503
503
|
: first;
|
|
504
504
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/merge",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/utils": "
|
|
10
|
+
"@graphql-tools/utils": "^8.4.0",
|
|
11
11
|
"tslib": "~2.3.0"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|