@graphql-tools/merge 8.0.2-alpha-801a4e8f.0 → 8.0.3
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 +2 -4
- package/es5/index.mjs +3 -5
- package/es5/package.json +2 -2
- package/index.js +2 -4
- package/index.mjs +3 -5
- package/package.json +2 -2
package/es5/index.js
CHANGED
|
@@ -414,10 +414,8 @@ function mergeFields(type, f1, f2, config) {
|
|
|
414
414
|
function preventConflicts(type, a, b, ignoreNullability) {
|
|
415
415
|
var aType = printTypeNode(a.type);
|
|
416
416
|
var bType = printTypeNode(b.type);
|
|
417
|
-
if (
|
|
418
|
-
|
|
419
|
-
throw new Error("Field '" + type.name.value + "." + a.name.value + "' changed type from '" + aType + "' to '" + bType + "'");
|
|
420
|
-
}
|
|
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 + "'");
|
|
421
419
|
}
|
|
422
420
|
}
|
|
423
421
|
function safeChangeForFieldType(oldType, newType, ignoreNullability) {
|
package/es5/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __values, __read, __spreadArray, __assign } from 'tslib';
|
|
2
|
-
import { mergeDeep, isSome, compareNodes,
|
|
2
|
+
import { mergeDeep, isSome, compareNodes, collectComment, resetComments, printWithComments, getDocumentNodeFromSchema, isDocumentNode } from '@graphql-tools/utils/es5';
|
|
3
3
|
import { print, Source, Kind, isSchema, parse, isDefinitionNode, isScalarType, isSpecifiedScalarType, isIntrospectionType, isObjectType, isInterfaceType, isInputObjectType, isUnionType, isEnumType } from 'graphql';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -411,10 +411,8 @@ function mergeFields(type, f1, f2, config) {
|
|
|
411
411
|
function preventConflicts(type, a, b, ignoreNullability) {
|
|
412
412
|
var aType = printTypeNode(a.type);
|
|
413
413
|
var bType = printTypeNode(b.type);
|
|
414
|
-
if (
|
|
415
|
-
|
|
416
|
-
throw new Error("Field '" + type.name.value + "." + a.name.value + "' changed type from '" + aType + "' to '" + bType + "'");
|
|
417
|
-
}
|
|
414
|
+
if (aType !== bType && !safeChangeForFieldType(a.type, b.type)) {
|
|
415
|
+
throw new Error("Field '" + type.name.value + "." + a.name.value + "' changed type from '" + aType + "' to '" + bType + "'");
|
|
418
416
|
}
|
|
419
417
|
}
|
|
420
418
|
function safeChangeForFieldType(oldType, newType, ignoreNullability) {
|
package/es5/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/merge/es5",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
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"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/utils": "^8.1.
|
|
10
|
+
"@graphql-tools/utils": "^8.1.2",
|
|
11
11
|
"tslib": "~2.3.0"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
package/index.js
CHANGED
|
@@ -340,10 +340,8 @@ function mergeFields(type, f1, f2, config) {
|
|
|
340
340
|
function preventConflicts(type, a, b, ignoreNullability = false) {
|
|
341
341
|
const aType = printTypeNode(a.type);
|
|
342
342
|
const bType = printTypeNode(b.type);
|
|
343
|
-
if (
|
|
344
|
-
|
|
345
|
-
throw new Error(`Field '${type.name.value}.${a.name.value}' changed type from '${aType}' to '${bType}'`);
|
|
346
|
-
}
|
|
343
|
+
if (aType !== bType && !safeChangeForFieldType(a.type, b.type, ignoreNullability)) {
|
|
344
|
+
throw new Error(`Field '${type.name.value}.${a.name.value}' changed type from '${aType}' to '${bType}'`);
|
|
347
345
|
}
|
|
348
346
|
}
|
|
349
347
|
function safeChangeForFieldType(oldType, newType, ignoreNullability = false) {
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeDeep, isSome, compareNodes,
|
|
1
|
+
import { mergeDeep, isSome, compareNodes, collectComment, resetComments, printWithComments, getDocumentNodeFromSchema, isDocumentNode } from '@graphql-tools/utils';
|
|
2
2
|
import { print, Source, Kind, isSchema, parse, isDefinitionNode, isScalarType, isSpecifiedScalarType, isIntrospectionType, isObjectType, isInterfaceType, isInputObjectType, isUnionType, isEnumType } from 'graphql';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -337,10 +337,8 @@ function mergeFields(type, f1, f2, config) {
|
|
|
337
337
|
function preventConflicts(type, a, b, ignoreNullability = false) {
|
|
338
338
|
const aType = printTypeNode(a.type);
|
|
339
339
|
const bType = printTypeNode(b.type);
|
|
340
|
-
if (
|
|
341
|
-
|
|
342
|
-
throw new Error(`Field '${type.name.value}.${a.name.value}' changed type from '${aType}' to '${bType}'`);
|
|
343
|
-
}
|
|
340
|
+
if (aType !== bType && !safeChangeForFieldType(a.type, b.type, ignoreNullability)) {
|
|
341
|
+
throw new Error(`Field '${type.name.value}.${a.name.value}' changed type from '${aType}' to '${bType}'`);
|
|
344
342
|
}
|
|
345
343
|
}
|
|
346
344
|
function safeChangeForFieldType(oldType, newType, ignoreNullability = false) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/merge",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
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"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/utils": "^8.1.
|
|
10
|
+
"@graphql-tools/utils": "^8.1.2",
|
|
11
11
|
"tslib": "~2.3.0"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|