graphql 14.4.2 → 14.5.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/README.md +5 -10
- package/error/GraphQLError.d.ts +87 -0
- package/error/GraphQLError.js +7 -45
- package/error/GraphQLError.js.flow +1 -0
- package/error/GraphQLError.mjs +7 -45
- package/error/formatError.d.ts +39 -0
- package/error/formatError.js +5 -2
- package/error/formatError.js.flow +27 -3
- package/error/formatError.mjs +5 -2
- package/error/index.d.ts +4 -0
- package/error/locatedError.d.ts +13 -0
- package/error/locatedError.js.flow +2 -1
- package/error/locatedError.mjs +1 -1
- package/error/syntaxError.d.ts +12 -0
- package/error/syntaxError.js.flow +1 -0
- package/execution/execute.d.ts +190 -0
- package/execution/execute.js +55 -89
- package/execution/execute.js.flow +95 -133
- package/execution/execute.mjs +75 -80
- package/execution/index.d.ts +11 -0
- package/execution/index.js +8 -6
- package/execution/index.js.flow +3 -6
- package/execution/index.mjs +2 -1
- package/execution/values.d.ts +68 -0
- package/execution/values.js +119 -128
- package/execution/values.js.flow +150 -127
- package/execution/values.mjs +117 -125
- package/graphql.d.ts +88 -0
- package/graphql.js +5 -5
- package/graphql.js.flow +9 -5
- package/graphql.mjs +41 -1
- package/index.d.ts +446 -0
- package/index.js +6 -0
- package/index.js.flow +3 -1
- package/index.mjs +2 -1
- package/jsutils/ObjMap.js.flow +6 -0
- package/jsutils/Path.d.ts +14 -0
- package/jsutils/Path.js +33 -0
- package/jsutils/Path.js.flow +26 -0
- package/jsutils/Path.mjs +24 -0
- package/jsutils/PromiseOrValue.d.ts +1 -0
- package/jsutils/dedent.js +6 -24
- package/jsutils/dedent.mjs +6 -24
- package/jsutils/defineToStringTag.js.flow +1 -1
- package/jsutils/devAssert.js +14 -0
- package/jsutils/devAssert.js.flow +8 -0
- package/jsutils/devAssert.mjs +7 -0
- package/jsutils/inspect.js +1 -1
- package/jsutils/inspect.js.flow +1 -1
- package/jsutils/inspect.mjs +1 -1
- package/jsutils/invariant.js +1 -2
- package/jsutils/invariant.js.flow +2 -3
- package/jsutils/invariant.mjs +1 -2
- package/jsutils/mapValue.js +6 -24
- package/jsutils/mapValue.js.flow +2 -1
- package/jsutils/mapValue.mjs +6 -24
- package/jsutils/printPathArray.js +15 -0
- package/jsutils/printPathArray.js.flow +14 -0
- package/jsutils/printPathArray.mjs +8 -0
- package/jsutils/suggestionList.js +14 -34
- package/jsutils/suggestionList.js.flow +4 -6
- package/jsutils/suggestionList.mjs +14 -34
- package/jsutils/toObjMap.js +28 -0
- package/jsutils/toObjMap.js.flow +26 -0
- package/jsutils/toObjMap.mjs +18 -0
- package/language/ast.d.ts +573 -0
- package/language/blockString.d.ts +21 -0
- package/language/directiveLocation.d.ts +35 -0
- package/language/index.d.ts +96 -0
- package/language/kinds.d.ts +77 -0
- package/language/lexer.d.ts +60 -0
- package/language/lexer.js +2 -12
- package/language/lexer.js.flow +6 -12
- package/language/lexer.mjs +1 -9
- package/language/location.d.ts +15 -0
- package/language/parser.d.ts +89 -0
- package/language/parser.js +1329 -1302
- package/language/parser.js.flow +1289 -1298
- package/language/parser.mjs +1326 -1297
- package/language/predicates.d.ts +36 -0
- package/language/predicates.js.flow +1 -1
- package/language/printLocation.d.ts +16 -0
- package/language/printLocation.js.flow +1 -1
- package/language/printer.d.ts +7 -0
- package/language/printer.js.flow +1 -1
- package/language/source.d.ts +19 -0
- package/language/source.js +3 -3
- package/language/source.js.flow +3 -3
- package/language/source.mjs +3 -3
- package/language/tokenKind.d.ts +35 -0
- package/language/visitor.d.ts +264 -0
- package/language/visitor.js +2 -2
- package/language/visitor.js.flow +3 -1
- package/language/visitor.mjs +2 -2
- package/package.json +1 -1
- package/polyfills/find.js +2 -2
- package/polyfills/find.js.flow +1 -2
- package/polyfills/find.mjs +2 -2
- package/polyfills/flatMap.js +3 -3
- package/polyfills/flatMap.js.flow +2 -3
- package/polyfills/flatMap.mjs +3 -3
- package/subscription/asyncIteratorReject.d.ts +6 -0
- package/subscription/index.d.ts +5 -0
- package/subscription/mapAsyncIterator.d.ts +9 -0
- package/subscription/mapAsyncIterator.js.flow +1 -0
- package/subscription/subscribe.d.ts +86 -0
- package/subscription/subscribe.js +29 -10
- package/subscription/subscribe.js.flow +45 -24
- package/subscription/subscribe.mjs +27 -9
- package/tsutils/Maybe.d.ts +4 -0
- package/type/definition.d.ts +805 -0
- package/type/definition.js +154 -70
- package/type/definition.js.flow +217 -160
- package/type/definition.mjs +149 -66
- package/type/directives.d.ts +72 -0
- package/type/directives.js +20 -12
- package/type/directives.js.flow +34 -19
- package/type/directives.mjs +17 -10
- package/type/index.d.ts +155 -0
- package/type/index.js.flow +2 -2
- package/type/introspection.d.ts +40 -0
- package/type/introspection.js +24 -10
- package/type/introspection.js.flow +29 -8
- package/type/introspection.mjs +23 -10
- package/type/scalars.d.ts +11 -0
- package/type/scalars.js +2 -2
- package/type/scalars.js.flow +4 -1
- package/type/scalars.mjs +2 -2
- package/type/schema.d.ts +108 -0
- package/type/schema.js +74 -151
- package/type/schema.js.flow +75 -73
- package/type/schema.mjs +75 -149
- package/type/validate.d.ts +19 -0
- package/type/validate.js +227 -486
- package/type/validate.js.flow +13 -8
- package/type/validate.mjs +218 -477
- package/utilities/TypeInfo.d.ts +49 -0
- package/utilities/TypeInfo.js.flow +9 -6
- package/utilities/assertValidName.d.ts +15 -0
- package/utilities/assertValidName.js +3 -3
- package/utilities/assertValidName.js.flow +3 -2
- package/utilities/assertValidName.mjs +2 -2
- package/utilities/astFromValue.d.ts +25 -0
- package/utilities/astFromValue.js +22 -38
- package/utilities/astFromValue.js.flow +7 -4
- package/utilities/astFromValue.mjs +19 -36
- package/utilities/buildASTSchema.d.ts +114 -0
- package/utilities/buildASTSchema.js +37 -68
- package/utilities/buildASTSchema.js.flow +32 -30
- package/utilities/buildASTSchema.mjs +32 -64
- package/utilities/buildClientSchema.d.ts +21 -0
- package/utilities/buildClientSchema.js +23 -15
- package/utilities/buildClientSchema.js.flow +17 -16
- package/utilities/buildClientSchema.mjs +20 -12
- package/utilities/coerceInputValue.d.ts +17 -0
- package/utilities/coerceInputValue.js +161 -0
- package/utilities/coerceInputValue.js.flow +214 -0
- package/utilities/coerceInputValue.mjs +142 -0
- package/utilities/coerceValue.d.ts +23 -0
- package/utilities/coerceValue.js +21 -199
- package/utilities/coerceValue.js.flow +31 -223
- package/utilities/coerceValue.mjs +20 -195
- package/utilities/concatAST.d.ts +8 -0
- package/utilities/concatAST.js.flow +1 -0
- package/utilities/extendSchema.d.ts +45 -0
- package/utilities/extendSchema.js +64 -131
- package/utilities/extendSchema.js.flow +27 -24
- package/utilities/extendSchema.mjs +61 -129
- package/utilities/findBreakingChanges.d.ts +64 -0
- package/utilities/findBreakingChanges.js +194 -619
- package/utilities/findBreakingChanges.js.flow +8 -5
- package/utilities/findBreakingChanges.mjs +194 -619
- package/utilities/findDeprecatedUsages.d.ts +13 -0
- package/utilities/findDeprecatedUsages.js.flow +4 -1
- package/utilities/getOperationAST.d.ts +12 -0
- package/utilities/getOperationAST.js +13 -31
- package/utilities/getOperationAST.mjs +13 -31
- package/utilities/getOperationRootType.d.ts +14 -0
- package/utilities/getOperationRootType.js.flow +2 -0
- package/utilities/index.d.ts +127 -0
- package/utilities/index.js +8 -0
- package/utilities/index.js.flow +4 -1
- package/utilities/index.mjs +3 -1
- package/utilities/introspectionFromSchema.d.ts +16 -0
- package/utilities/introspectionFromSchema.js +5 -3
- package/utilities/introspectionFromSchema.js.flow +4 -2
- package/utilities/introspectionFromSchema.mjs +4 -2
- package/utilities/introspectionQuery.d.ts +177 -0
- package/utilities/isValidJSValue.d.ts +8 -0
- package/utilities/isValidJSValue.js +1 -1
- package/utilities/isValidJSValue.js.flow +3 -2
- package/utilities/isValidJSValue.mjs +2 -2
- package/utilities/isValidLiteralValue.d.ts +15 -0
- package/utilities/isValidLiteralValue.js +4 -4
- package/utilities/isValidLiteralValue.js.flow +8 -4
- package/utilities/isValidLiteralValue.mjs +2 -2
- package/utilities/lexicographicSortSchema.d.ts +6 -0
- package/utilities/lexicographicSortSchema.js +11 -8
- package/utilities/lexicographicSortSchema.js.flow +5 -3
- package/utilities/lexicographicSortSchema.mjs +9 -7
- package/utilities/schemaPrinter.d.ts +30 -0
- package/utilities/schemaPrinter.js +15 -32
- package/utilities/schemaPrinter.js.flow +14 -10
- package/utilities/schemaPrinter.mjs +14 -32
- package/utilities/separateOperations.d.ts +11 -0
- package/utilities/separateOperations.js +6 -6
- package/utilities/separateOperations.js.flow +2 -1
- package/utilities/separateOperations.mjs +6 -6
- package/utilities/stripIgnoredCharacters.d.ts +55 -0
- package/utilities/stripIgnoredCharacters.js.flow +1 -0
- package/utilities/typeComparators.d.ts +32 -0
- package/utilities/typeComparators.js.flow +1 -1
- package/utilities/typeComparators.mjs +1 -1
- package/utilities/typeFromAST.d.ts +29 -0
- package/utilities/typeFromAST.js +5 -3
- package/utilities/typeFromAST.js.flow +5 -3
- package/utilities/typeFromAST.mjs +14 -3
- package/utilities/valueFromAST.d.ts +29 -0
- package/utilities/valueFromAST.js +40 -74
- package/utilities/valueFromAST.js.flow +7 -4
- package/utilities/valueFromAST.mjs +39 -74
- package/utilities/valueFromASTUntyped.d.ts +23 -0
- package/utilities/valueFromASTUntyped.js +4 -3
- package/utilities/valueFromASTUntyped.js.flow +3 -2
- package/utilities/valueFromASTUntyped.mjs +3 -3
- package/validation/ValidationContext.d.ts +96 -0
- package/validation/ValidationContext.js +38 -86
- package/validation/ValidationContext.js.flow +22 -7
- package/validation/ValidationContext.mjs +37 -85
- package/validation/index.d.ts +126 -0
- package/validation/rules/ExecutableDefinitions.d.ts +14 -0
- package/validation/rules/ExecutableDefinitions.js +4 -23
- package/validation/rules/ExecutableDefinitions.js.flow +4 -2
- package/validation/rules/ExecutableDefinitions.mjs +4 -23
- package/validation/rules/FieldsOnCorrectType.d.ts +17 -0
- package/validation/rules/FieldsOnCorrectType.js +21 -57
- package/validation/rules/FieldsOnCorrectType.js.flow +7 -3
- package/validation/rules/FieldsOnCorrectType.mjs +21 -57
- package/validation/rules/FragmentsOnCompositeTypes.d.ts +20 -0
- package/validation/rules/FragmentsOnCompositeTypes.js.flow +5 -1
- package/validation/rules/KnownArgumentNames.d.ts +28 -0
- package/validation/rules/KnownArgumentNames.js +26 -79
- package/validation/rules/KnownArgumentNames.js.flow +10 -6
- package/validation/rules/KnownArgumentNames.mjs +22 -75
- package/validation/rules/KnownDirectives.d.ts +19 -0
- package/validation/rules/KnownDirectives.js +12 -48
- package/validation/rules/KnownDirectives.js.flow +8 -5
- package/validation/rules/KnownDirectives.mjs +12 -48
- package/validation/rules/KnownFragmentNames.d.ts +12 -0
- package/validation/rules/KnownFragmentNames.js.flow +2 -1
- package/validation/rules/KnownTypeNames.d.ts +15 -0
- package/validation/rules/KnownTypeNames.js +6 -24
- package/validation/rules/KnownTypeNames.js.flow +10 -6
- package/validation/rules/KnownTypeNames.mjs +6 -24
- package/validation/rules/LoneAnonymousOperation.d.ts +14 -0
- package/validation/rules/LoneAnonymousOperation.js.flow +3 -1
- package/validation/rules/LoneSchemaDefinition.d.ts +13 -0
- package/validation/rules/LoneSchemaDefinition.js.flow +2 -1
- package/validation/rules/NoFragmentCycles.d.ts +9 -0
- package/validation/rules/NoFragmentCycles.js +17 -35
- package/validation/rules/NoFragmentCycles.js.flow +4 -2
- package/validation/rules/NoFragmentCycles.mjs +17 -35
- package/validation/rules/NoUndefinedVariables.d.ts +16 -0
- package/validation/rules/NoUndefinedVariables.js +6 -24
- package/validation/rules/NoUndefinedVariables.js.flow +2 -1
- package/validation/rules/NoUndefinedVariables.mjs +6 -24
- package/validation/rules/NoUnusedFragments.d.ts +12 -0
- package/validation/rules/NoUnusedFragments.js +7 -25
- package/validation/rules/NoUnusedFragments.js.flow +2 -1
- package/validation/rules/NoUnusedFragments.mjs +7 -25
- package/validation/rules/NoUnusedVariables.d.ts +16 -0
- package/validation/rules/NoUnusedVariables.js +6 -24
- package/validation/rules/NoUnusedVariables.js.flow +2 -1
- package/validation/rules/NoUnusedVariables.mjs +6 -24
- package/validation/rules/OverlappingFieldsCanBeMerged.d.ts +24 -0
- package/validation/rules/OverlappingFieldsCanBeMerged.js +27 -46
- package/validation/rules/OverlappingFieldsCanBeMerged.js.flow +17 -8
- package/validation/rules/OverlappingFieldsCanBeMerged.mjs +25 -44
- package/validation/rules/PossibleFragmentSpreads.d.ts +22 -0
- package/validation/rules/PossibleFragmentSpreads.js +2 -2
- package/validation/rules/PossibleFragmentSpreads.js.flow +8 -3
- package/validation/rules/PossibleFragmentSpreads.mjs +2 -2
- package/validation/rules/PossibleTypeExtensions.d.ts +21 -0
- package/validation/rules/PossibleTypeExtensions.js +4 -22
- package/validation/rules/PossibleTypeExtensions.js.flow +6 -2
- package/validation/rules/PossibleTypeExtensions.mjs +4 -22
- package/validation/rules/ProvidedRequiredArguments.d.ts +29 -0
- package/validation/rules/ProvidedRequiredArguments.js +27 -79
- package/validation/rules/ProvidedRequiredArguments.js.flow +12 -8
- package/validation/rules/ProvidedRequiredArguments.mjs +25 -77
- package/validation/rules/ScalarLeafs.d.ts +20 -0
- package/validation/rules/ScalarLeafs.js.flow +6 -2
- package/validation/rules/SingleFieldSubscriptions.d.ts +14 -0
- package/validation/rules/SingleFieldSubscriptions.js.flow +4 -2
- package/validation/rules/UniqueArgumentNames.d.ts +12 -0
- package/validation/rules/UniqueArgumentNames.js.flow +2 -1
- package/validation/rules/UniqueDirectiveNames.d.ts +13 -0
- package/validation/rules/UniqueDirectiveNames.js.flow +2 -1
- package/validation/rules/UniqueDirectivesPerLocation.d.ts +14 -0
- package/validation/rules/UniqueDirectivesPerLocation.js +15 -69
- package/validation/rules/UniqueDirectivesPerLocation.js.flow +7 -4
- package/validation/rules/UniqueDirectivesPerLocation.mjs +15 -69
- package/validation/rules/UniqueEnumValueNames.d.ts +19 -0
- package/validation/rules/UniqueEnumValueNames.js +10 -28
- package/validation/rules/UniqueEnumValueNames.js.flow +2 -1
- package/validation/rules/UniqueEnumValueNames.mjs +10 -28
- package/validation/rules/UniqueFieldDefinitionNames.d.ts +21 -0
- package/validation/rules/UniqueFieldDefinitionNames.js +9 -27
- package/validation/rules/UniqueFieldDefinitionNames.js.flow +2 -1
- package/validation/rules/UniqueFieldDefinitionNames.mjs +9 -27
- package/validation/rules/UniqueFragmentNames.d.ts +11 -0
- package/validation/rules/UniqueFragmentNames.js.flow +2 -1
- package/validation/rules/UniqueInputFieldNames.d.ts +14 -0
- package/validation/rules/UniqueInputFieldNames.js.flow +2 -1
- package/validation/rules/UniqueOperationNames.d.ts +11 -0
- package/validation/rules/UniqueOperationNames.js.flow +2 -1
- package/validation/rules/UniqueOperationTypes.d.ts +13 -0
- package/validation/rules/UniqueOperationTypes.js +11 -30
- package/validation/rules/UniqueOperationTypes.js.flow +2 -1
- package/validation/rules/UniqueOperationTypes.mjs +10 -29
- package/validation/rules/UniqueTypeNames.d.ts +13 -0
- package/validation/rules/UniqueTypeNames.js.flow +3 -1
- package/validation/rules/UniqueVariableNames.d.ts +11 -0
- package/validation/rules/UniqueVariableNames.js.flow +4 -2
- package/validation/rules/ValuesOfCorrectType.d.ts +34 -0
- package/validation/rules/ValuesOfCorrectType.js +16 -34
- package/validation/rules/ValuesOfCorrectType.js.flow +11 -6
- package/validation/rules/ValuesOfCorrectType.mjs +12 -30
- package/validation/rules/VariablesAreInputTypes.d.ts +15 -0
- package/validation/rules/VariablesAreInputTypes.js.flow +6 -2
- package/validation/rules/VariablesInAllowedPosition.d.ts +15 -0
- package/validation/rules/VariablesInAllowedPosition.js +22 -40
- package/validation/rules/VariablesInAllowedPosition.js.flow +8 -3
- package/validation/rules/VariablesInAllowedPosition.mjs +18 -36
- package/validation/specifiedRules.d.ts +98 -0
- package/validation/validate.d.ts +56 -0
- package/validation/validate.js +35 -7
- package/validation/validate.js.flow +51 -9
- package/validation/validate.mjs +30 -7
- package/version.d.ts +14 -0
- package/version.js +3 -3
- package/version.js.flow +3 -3
- package/version.mjs +3 -3
|
@@ -60,141 +60,48 @@ function findSchemaChanges(oldSchema, newSchema) {
|
|
|
60
60
|
function findDirectiveChanges(oldSchema, newSchema) {
|
|
61
61
|
var schemaChanges = [];
|
|
62
62
|
var directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives());
|
|
63
|
-
var _iteratorNormalCompletion = true;
|
|
64
|
-
var _didIteratorError = false;
|
|
65
|
-
var _iteratorError = undefined;
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
} catch (err) {
|
|
76
|
-
_didIteratorError = true;
|
|
77
|
-
_iteratorError = err;
|
|
78
|
-
} finally {
|
|
79
|
-
try {
|
|
80
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
81
|
-
_iterator.return();
|
|
82
|
-
}
|
|
83
|
-
} finally {
|
|
84
|
-
if (_didIteratorError) {
|
|
85
|
-
throw _iteratorError;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
64
|
+
for (var _i2 = 0, _directivesDiff$remov2 = directivesDiff.removed; _i2 < _directivesDiff$remov2.length; _i2++) {
|
|
65
|
+
var oldDirective = _directivesDiff$remov2[_i2];
|
|
66
|
+
schemaChanges.push({
|
|
67
|
+
type: BreakingChangeType.DIRECTIVE_REMOVED,
|
|
68
|
+
description: "".concat(oldDirective.name, " was removed.")
|
|
69
|
+
});
|
|
88
70
|
}
|
|
89
71
|
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
for (var _iterator2 = directivesDiff.persisted[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
96
|
-
var _ref2 = _step2.value;
|
|
97
|
-
var _oldDirective = _ref2[0];
|
|
98
|
-
var newDirective = _ref2[1];
|
|
99
|
-
var argsDiff = diff(_oldDirective.args, newDirective.args);
|
|
100
|
-
var _iteratorNormalCompletion3 = true;
|
|
101
|
-
var _didIteratorError3 = false;
|
|
102
|
-
var _iteratorError3 = undefined;
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
for (var _iterator3 = argsDiff.added[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
106
|
-
var newArg = _step3.value;
|
|
107
|
-
|
|
108
|
-
if (isRequiredArgument(newArg)) {
|
|
109
|
-
schemaChanges.push({
|
|
110
|
-
type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,
|
|
111
|
-
description: "A required arg ".concat(newArg.name, " on directive ").concat(_oldDirective.name, " was added.")
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
} catch (err) {
|
|
116
|
-
_didIteratorError3 = true;
|
|
117
|
-
_iteratorError3 = err;
|
|
118
|
-
} finally {
|
|
119
|
-
try {
|
|
120
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
121
|
-
_iterator3.return();
|
|
122
|
-
}
|
|
123
|
-
} finally {
|
|
124
|
-
if (_didIteratorError3) {
|
|
125
|
-
throw _iteratorError3;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
72
|
+
for (var _i4 = 0, _directivesDiff$persi2 = directivesDiff.persisted; _i4 < _directivesDiff$persi2.length; _i4++) {
|
|
73
|
+
var _ref2 = _directivesDiff$persi2[_i4];
|
|
74
|
+
var _oldDirective = _ref2[0];
|
|
75
|
+
var newDirective = _ref2[1];
|
|
76
|
+
var argsDiff = diff(_oldDirective.args, newDirective.args);
|
|
129
77
|
|
|
130
|
-
|
|
131
|
-
var
|
|
132
|
-
var _iteratorError4 = undefined;
|
|
78
|
+
for (var _i6 = 0, _argsDiff$added2 = argsDiff.added; _i6 < _argsDiff$added2.length; _i6++) {
|
|
79
|
+
var newArg = _argsDiff$added2[_i6];
|
|
133
80
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
description: "".concat(oldArg.name, " was removed from ").concat(_oldDirective.name, ".")
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
} catch (err) {
|
|
143
|
-
_didIteratorError4 = true;
|
|
144
|
-
_iteratorError4 = err;
|
|
145
|
-
} finally {
|
|
146
|
-
try {
|
|
147
|
-
if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
|
|
148
|
-
_iterator4.return();
|
|
149
|
-
}
|
|
150
|
-
} finally {
|
|
151
|
-
if (_didIteratorError4) {
|
|
152
|
-
throw _iteratorError4;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
81
|
+
if (isRequiredArgument(newArg)) {
|
|
82
|
+
schemaChanges.push({
|
|
83
|
+
type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,
|
|
84
|
+
description: "A required arg ".concat(newArg.name, " on directive ").concat(_oldDirective.name, " was added.")
|
|
85
|
+
});
|
|
155
86
|
}
|
|
87
|
+
}
|
|
156
88
|
|
|
157
|
-
|
|
158
|
-
var
|
|
159
|
-
|
|
89
|
+
for (var _i8 = 0, _argsDiff$removed2 = argsDiff.removed; _i8 < _argsDiff$removed2.length; _i8++) {
|
|
90
|
+
var oldArg = _argsDiff$removed2[_i8];
|
|
91
|
+
schemaChanges.push({
|
|
92
|
+
type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,
|
|
93
|
+
description: "".concat(oldArg.name, " was removed from ").concat(_oldDirective.name, ".")
|
|
94
|
+
});
|
|
95
|
+
}
|
|
160
96
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
var location = _step5.value;
|
|
97
|
+
for (var _i10 = 0, _oldDirective$locatio2 = _oldDirective.locations; _i10 < _oldDirective$locatio2.length; _i10++) {
|
|
98
|
+
var location = _oldDirective$locatio2[_i10];
|
|
164
99
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
} catch (err) {
|
|
173
|
-
_didIteratorError5 = true;
|
|
174
|
-
_iteratorError5 = err;
|
|
175
|
-
} finally {
|
|
176
|
-
try {
|
|
177
|
-
if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
|
|
178
|
-
_iterator5.return();
|
|
179
|
-
}
|
|
180
|
-
} finally {
|
|
181
|
-
if (_didIteratorError5) {
|
|
182
|
-
throw _iteratorError5;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
} catch (err) {
|
|
188
|
-
_didIteratorError2 = true;
|
|
189
|
-
_iteratorError2 = err;
|
|
190
|
-
} finally {
|
|
191
|
-
try {
|
|
192
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
193
|
-
_iterator2.return();
|
|
194
|
-
}
|
|
195
|
-
} finally {
|
|
196
|
-
if (_didIteratorError2) {
|
|
197
|
-
throw _iteratorError2;
|
|
100
|
+
if (newDirective.locations.indexOf(location) === -1) {
|
|
101
|
+
schemaChanges.push({
|
|
102
|
+
type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,
|
|
103
|
+
description: "".concat(location, " was removed from ").concat(_oldDirective.name, ".")
|
|
104
|
+
});
|
|
198
105
|
}
|
|
199
106
|
}
|
|
200
107
|
}
|
|
@@ -205,72 +112,35 @@ function findDirectiveChanges(oldSchema, newSchema) {
|
|
|
205
112
|
function findTypeChanges(oldSchema, newSchema) {
|
|
206
113
|
var schemaChanges = [];
|
|
207
114
|
var typesDiff = diff(objectValues(oldSchema.getTypeMap()), objectValues(newSchema.getTypeMap()));
|
|
208
|
-
var _iteratorNormalCompletion6 = true;
|
|
209
|
-
var _didIteratorError6 = false;
|
|
210
|
-
var _iteratorError6 = undefined;
|
|
211
115
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
} catch (err) {
|
|
221
|
-
_didIteratorError6 = true;
|
|
222
|
-
_iteratorError6 = err;
|
|
223
|
-
} finally {
|
|
224
|
-
try {
|
|
225
|
-
if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
|
|
226
|
-
_iterator6.return();
|
|
227
|
-
}
|
|
228
|
-
} finally {
|
|
229
|
-
if (_didIteratorError6) {
|
|
230
|
-
throw _iteratorError6;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
116
|
+
for (var _i12 = 0, _typesDiff$removed2 = typesDiff.removed; _i12 < _typesDiff$removed2.length; _i12++) {
|
|
117
|
+
var oldType = _typesDiff$removed2[_i12];
|
|
118
|
+
schemaChanges.push({
|
|
119
|
+
type: BreakingChangeType.TYPE_REMOVED,
|
|
120
|
+
description: "".concat(oldType.name, " was removed.")
|
|
121
|
+
});
|
|
233
122
|
}
|
|
234
123
|
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
} else if (_oldType.constructor !== newType.constructor) {
|
|
256
|
-
schemaChanges.push({
|
|
257
|
-
type: BreakingChangeType.TYPE_CHANGED_KIND,
|
|
258
|
-
description: "".concat(_oldType.name, " changed from ") + "".concat(typeKindName(_oldType), " to ").concat(typeKindName(newType), ".")
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
} catch (err) {
|
|
263
|
-
_didIteratorError7 = true;
|
|
264
|
-
_iteratorError7 = err;
|
|
265
|
-
} finally {
|
|
266
|
-
try {
|
|
267
|
-
if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
|
|
268
|
-
_iterator7.return();
|
|
269
|
-
}
|
|
270
|
-
} finally {
|
|
271
|
-
if (_didIteratorError7) {
|
|
272
|
-
throw _iteratorError7;
|
|
273
|
-
}
|
|
124
|
+
for (var _i14 = 0, _typesDiff$persisted2 = typesDiff.persisted; _i14 < _typesDiff$persisted2.length; _i14++) {
|
|
125
|
+
var _ref4 = _typesDiff$persisted2[_i14];
|
|
126
|
+
var _oldType = _ref4[0];
|
|
127
|
+
var newType = _ref4[1];
|
|
128
|
+
|
|
129
|
+
if (isEnumType(_oldType) && isEnumType(newType)) {
|
|
130
|
+
schemaChanges.push.apply(schemaChanges, findEnumTypeChanges(_oldType, newType));
|
|
131
|
+
} else if (isUnionType(_oldType) && isUnionType(newType)) {
|
|
132
|
+
schemaChanges.push.apply(schemaChanges, findUnionTypeChanges(_oldType, newType));
|
|
133
|
+
} else if (isInputObjectType(_oldType) && isInputObjectType(newType)) {
|
|
134
|
+
schemaChanges.push.apply(schemaChanges, findInputObjectTypeChanges(_oldType, newType));
|
|
135
|
+
} else if (isObjectType(_oldType) && isObjectType(newType)) {
|
|
136
|
+
schemaChanges.push.apply(schemaChanges, findObjectTypeChanges(_oldType, newType));
|
|
137
|
+
} else if (isInterfaceType(_oldType) && isInterfaceType(newType)) {
|
|
138
|
+
schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType));
|
|
139
|
+
} else if (_oldType.constructor !== newType.constructor) {
|
|
140
|
+
schemaChanges.push({
|
|
141
|
+
type: BreakingChangeType.TYPE_CHANGED_KIND,
|
|
142
|
+
description: "".concat(_oldType.name, " changed from ") + "".concat(typeKindName(_oldType), " to ").concat(typeKindName(newType), ".")
|
|
143
|
+
});
|
|
274
144
|
}
|
|
275
145
|
}
|
|
276
146
|
|
|
@@ -280,98 +150,42 @@ function findTypeChanges(oldSchema, newSchema) {
|
|
|
280
150
|
function findInputObjectTypeChanges(oldType, newType) {
|
|
281
151
|
var schemaChanges = [];
|
|
282
152
|
var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields()));
|
|
283
|
-
var _iteratorNormalCompletion8 = true;
|
|
284
|
-
var _didIteratorError8 = false;
|
|
285
|
-
var _iteratorError8 = undefined;
|
|
286
|
-
|
|
287
|
-
try {
|
|
288
|
-
for (var _iterator8 = fieldsDiff.added[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
|
|
289
|
-
var newField = _step8.value;
|
|
290
153
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,
|
|
294
|
-
description: "A required field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.")
|
|
295
|
-
});
|
|
296
|
-
} else {
|
|
297
|
-
schemaChanges.push({
|
|
298
|
-
type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,
|
|
299
|
-
description: "An optional field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.")
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
} catch (err) {
|
|
304
|
-
_didIteratorError8 = true;
|
|
305
|
-
_iteratorError8 = err;
|
|
306
|
-
} finally {
|
|
307
|
-
try {
|
|
308
|
-
if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
|
|
309
|
-
_iterator8.return();
|
|
310
|
-
}
|
|
311
|
-
} finally {
|
|
312
|
-
if (_didIteratorError8) {
|
|
313
|
-
throw _iteratorError8;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
154
|
+
for (var _i16 = 0, _fieldsDiff$added2 = fieldsDiff.added; _i16 < _fieldsDiff$added2.length; _i16++) {
|
|
155
|
+
var newField = _fieldsDiff$added2[_i16];
|
|
317
156
|
|
|
318
|
-
|
|
319
|
-
var _didIteratorError9 = false;
|
|
320
|
-
var _iteratorError9 = undefined;
|
|
321
|
-
|
|
322
|
-
try {
|
|
323
|
-
for (var _iterator9 = fieldsDiff.removed[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
|
|
324
|
-
var oldField = _step9.value;
|
|
157
|
+
if (isRequiredInputField(newField)) {
|
|
325
158
|
schemaChanges.push({
|
|
326
|
-
type: BreakingChangeType.
|
|
327
|
-
description: "".concat(
|
|
159
|
+
type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,
|
|
160
|
+
description: "A required field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.")
|
|
161
|
+
});
|
|
162
|
+
} else {
|
|
163
|
+
schemaChanges.push({
|
|
164
|
+
type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,
|
|
165
|
+
description: "An optional field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.")
|
|
328
166
|
});
|
|
329
|
-
}
|
|
330
|
-
} catch (err) {
|
|
331
|
-
_didIteratorError9 = true;
|
|
332
|
-
_iteratorError9 = err;
|
|
333
|
-
} finally {
|
|
334
|
-
try {
|
|
335
|
-
if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
|
|
336
|
-
_iterator9.return();
|
|
337
|
-
}
|
|
338
|
-
} finally {
|
|
339
|
-
if (_didIteratorError9) {
|
|
340
|
-
throw _iteratorError9;
|
|
341
|
-
}
|
|
342
167
|
}
|
|
343
168
|
}
|
|
344
169
|
|
|
345
|
-
var
|
|
346
|
-
|
|
347
|
-
|
|
170
|
+
for (var _i18 = 0, _fieldsDiff$removed2 = fieldsDiff.removed; _i18 < _fieldsDiff$removed2.length; _i18++) {
|
|
171
|
+
var oldField = _fieldsDiff$removed2[_i18];
|
|
172
|
+
schemaChanges.push({
|
|
173
|
+
type: BreakingChangeType.FIELD_REMOVED,
|
|
174
|
+
description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.")
|
|
175
|
+
});
|
|
176
|
+
}
|
|
348
177
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldField.type, _newField.type);
|
|
178
|
+
for (var _i20 = 0, _fieldsDiff$persisted2 = fieldsDiff.persisted; _i20 < _fieldsDiff$persisted2.length; _i20++) {
|
|
179
|
+
var _ref6 = _fieldsDiff$persisted2[_i20];
|
|
180
|
+
var _oldField = _ref6[0];
|
|
181
|
+
var _newField = _ref6[1];
|
|
182
|
+
var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldField.type, _newField.type);
|
|
355
183
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
} catch (err) {
|
|
364
|
-
_didIteratorError10 = true;
|
|
365
|
-
_iteratorError10 = err;
|
|
366
|
-
} finally {
|
|
367
|
-
try {
|
|
368
|
-
if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
|
|
369
|
-
_iterator10.return();
|
|
370
|
-
}
|
|
371
|
-
} finally {
|
|
372
|
-
if (_didIteratorError10) {
|
|
373
|
-
throw _iteratorError10;
|
|
374
|
-
}
|
|
184
|
+
if (!isSafe) {
|
|
185
|
+
schemaChanges.push({
|
|
186
|
+
type: BreakingChangeType.FIELD_CHANGED_KIND,
|
|
187
|
+
description: "".concat(oldType.name, ".").concat(_oldField.name, " changed type from ") + "".concat(String(_oldField.type), " to ").concat(String(_newField.type), ".")
|
|
188
|
+
});
|
|
375
189
|
}
|
|
376
190
|
}
|
|
377
191
|
|
|
@@ -381,58 +195,21 @@ function findInputObjectTypeChanges(oldType, newType) {
|
|
|
381
195
|
function findUnionTypeChanges(oldType, newType) {
|
|
382
196
|
var schemaChanges = [];
|
|
383
197
|
var possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes());
|
|
384
|
-
var _iteratorNormalCompletion11 = true;
|
|
385
|
-
var _didIteratorError11 = false;
|
|
386
|
-
var _iteratorError11 = undefined;
|
|
387
198
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
} catch (err) {
|
|
397
|
-
_didIteratorError11 = true;
|
|
398
|
-
_iteratorError11 = err;
|
|
399
|
-
} finally {
|
|
400
|
-
try {
|
|
401
|
-
if (!_iteratorNormalCompletion11 && _iterator11.return != null) {
|
|
402
|
-
_iterator11.return();
|
|
403
|
-
}
|
|
404
|
-
} finally {
|
|
405
|
-
if (_didIteratorError11) {
|
|
406
|
-
throw _iteratorError11;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
199
|
+
for (var _i22 = 0, _possibleTypesDiff$ad2 = possibleTypesDiff.added; _i22 < _possibleTypesDiff$ad2.length; _i22++) {
|
|
200
|
+
var newPossibleType = _possibleTypesDiff$ad2[_i22];
|
|
201
|
+
schemaChanges.push({
|
|
202
|
+
type: DangerousChangeType.TYPE_ADDED_TO_UNION,
|
|
203
|
+
description: "".concat(newPossibleType.name, " was added to union type ").concat(oldType.name, ".")
|
|
204
|
+
});
|
|
409
205
|
}
|
|
410
206
|
|
|
411
|
-
var
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
var oldPossibleType = _step12.value;
|
|
418
|
-
schemaChanges.push({
|
|
419
|
-
type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,
|
|
420
|
-
description: "".concat(oldPossibleType.name, " was removed from union type ").concat(oldType.name, ".")
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
} catch (err) {
|
|
424
|
-
_didIteratorError12 = true;
|
|
425
|
-
_iteratorError12 = err;
|
|
426
|
-
} finally {
|
|
427
|
-
try {
|
|
428
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) {
|
|
429
|
-
_iterator12.return();
|
|
430
|
-
}
|
|
431
|
-
} finally {
|
|
432
|
-
if (_didIteratorError12) {
|
|
433
|
-
throw _iteratorError12;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
207
|
+
for (var _i24 = 0, _possibleTypesDiff$re2 = possibleTypesDiff.removed; _i24 < _possibleTypesDiff$re2.length; _i24++) {
|
|
208
|
+
var oldPossibleType = _possibleTypesDiff$re2[_i24];
|
|
209
|
+
schemaChanges.push({
|
|
210
|
+
type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,
|
|
211
|
+
description: "".concat(oldPossibleType.name, " was removed from union type ").concat(oldType.name, ".")
|
|
212
|
+
});
|
|
436
213
|
}
|
|
437
214
|
|
|
438
215
|
return schemaChanges;
|
|
@@ -441,58 +218,21 @@ function findUnionTypeChanges(oldType, newType) {
|
|
|
441
218
|
function findEnumTypeChanges(oldType, newType) {
|
|
442
219
|
var schemaChanges = [];
|
|
443
220
|
var valuesDiff = diff(oldType.getValues(), newType.getValues());
|
|
444
|
-
var _iteratorNormalCompletion13 = true;
|
|
445
|
-
var _didIteratorError13 = false;
|
|
446
|
-
var _iteratorError13 = undefined;
|
|
447
221
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
} catch (err) {
|
|
457
|
-
_didIteratorError13 = true;
|
|
458
|
-
_iteratorError13 = err;
|
|
459
|
-
} finally {
|
|
460
|
-
try {
|
|
461
|
-
if (!_iteratorNormalCompletion13 && _iterator13.return != null) {
|
|
462
|
-
_iterator13.return();
|
|
463
|
-
}
|
|
464
|
-
} finally {
|
|
465
|
-
if (_didIteratorError13) {
|
|
466
|
-
throw _iteratorError13;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
222
|
+
for (var _i26 = 0, _valuesDiff$added2 = valuesDiff.added; _i26 < _valuesDiff$added2.length; _i26++) {
|
|
223
|
+
var newValue = _valuesDiff$added2[_i26];
|
|
224
|
+
schemaChanges.push({
|
|
225
|
+
type: DangerousChangeType.VALUE_ADDED_TO_ENUM,
|
|
226
|
+
description: "".concat(newValue.name, " was added to enum type ").concat(oldType.name, ".")
|
|
227
|
+
});
|
|
469
228
|
}
|
|
470
229
|
|
|
471
|
-
var
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
var oldValue = _step14.value;
|
|
478
|
-
schemaChanges.push({
|
|
479
|
-
type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,
|
|
480
|
-
description: "".concat(oldValue.name, " was removed from enum type ").concat(oldType.name, ".")
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
} catch (err) {
|
|
484
|
-
_didIteratorError14 = true;
|
|
485
|
-
_iteratorError14 = err;
|
|
486
|
-
} finally {
|
|
487
|
-
try {
|
|
488
|
-
if (!_iteratorNormalCompletion14 && _iterator14.return != null) {
|
|
489
|
-
_iterator14.return();
|
|
490
|
-
}
|
|
491
|
-
} finally {
|
|
492
|
-
if (_didIteratorError14) {
|
|
493
|
-
throw _iteratorError14;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
230
|
+
for (var _i28 = 0, _valuesDiff$removed2 = valuesDiff.removed; _i28 < _valuesDiff$removed2.length; _i28++) {
|
|
231
|
+
var oldValue = _valuesDiff$removed2[_i28];
|
|
232
|
+
schemaChanges.push({
|
|
233
|
+
type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,
|
|
234
|
+
description: "".concat(oldValue.name, " was removed from enum type ").concat(oldType.name, ".")
|
|
235
|
+
});
|
|
496
236
|
}
|
|
497
237
|
|
|
498
238
|
return schemaChanges;
|
|
@@ -501,58 +241,21 @@ function findEnumTypeChanges(oldType, newType) {
|
|
|
501
241
|
function findObjectTypeChanges(oldType, newType) {
|
|
502
242
|
var schemaChanges = findFieldChanges(oldType, newType);
|
|
503
243
|
var interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces());
|
|
504
|
-
var _iteratorNormalCompletion15 = true;
|
|
505
|
-
var _didIteratorError15 = false;
|
|
506
|
-
var _iteratorError15 = undefined;
|
|
507
244
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
} catch (err) {
|
|
517
|
-
_didIteratorError15 = true;
|
|
518
|
-
_iteratorError15 = err;
|
|
519
|
-
} finally {
|
|
520
|
-
try {
|
|
521
|
-
if (!_iteratorNormalCompletion15 && _iterator15.return != null) {
|
|
522
|
-
_iterator15.return();
|
|
523
|
-
}
|
|
524
|
-
} finally {
|
|
525
|
-
if (_didIteratorError15) {
|
|
526
|
-
throw _iteratorError15;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
245
|
+
for (var _i30 = 0, _interfacesDiff$added2 = interfacesDiff.added; _i30 < _interfacesDiff$added2.length; _i30++) {
|
|
246
|
+
var newInterface = _interfacesDiff$added2[_i30];
|
|
247
|
+
schemaChanges.push({
|
|
248
|
+
type: DangerousChangeType.INTERFACE_ADDED_TO_OBJECT,
|
|
249
|
+
description: "".concat(newInterface.name, " added to interfaces implemented by ").concat(oldType.name, ".")
|
|
250
|
+
});
|
|
529
251
|
}
|
|
530
252
|
|
|
531
|
-
var
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
var oldInterface = _step16.value;
|
|
538
|
-
schemaChanges.push({
|
|
539
|
-
type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT,
|
|
540
|
-
description: "".concat(oldType.name, " no longer implements interface ").concat(oldInterface.name, ".")
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
} catch (err) {
|
|
544
|
-
_didIteratorError16 = true;
|
|
545
|
-
_iteratorError16 = err;
|
|
546
|
-
} finally {
|
|
547
|
-
try {
|
|
548
|
-
if (!_iteratorNormalCompletion16 && _iterator16.return != null) {
|
|
549
|
-
_iterator16.return();
|
|
550
|
-
}
|
|
551
|
-
} finally {
|
|
552
|
-
if (_didIteratorError16) {
|
|
553
|
-
throw _iteratorError16;
|
|
554
|
-
}
|
|
555
|
-
}
|
|
253
|
+
for (var _i32 = 0, _interfacesDiff$remov2 = interfacesDiff.removed; _i32 < _interfacesDiff$remov2.length; _i32++) {
|
|
254
|
+
var oldInterface = _interfacesDiff$remov2[_i32];
|
|
255
|
+
schemaChanges.push({
|
|
256
|
+
type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT,
|
|
257
|
+
description: "".concat(oldType.name, " no longer implements interface ").concat(oldInterface.name, ".")
|
|
258
|
+
});
|
|
556
259
|
}
|
|
557
260
|
|
|
558
261
|
return schemaChanges;
|
|
@@ -561,64 +264,27 @@ function findObjectTypeChanges(oldType, newType) {
|
|
|
561
264
|
function findFieldChanges(oldType, newType) {
|
|
562
265
|
var schemaChanges = [];
|
|
563
266
|
var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields()));
|
|
564
|
-
var _iteratorNormalCompletion17 = true;
|
|
565
|
-
var _didIteratorError17 = false;
|
|
566
|
-
var _iteratorError17 = undefined;
|
|
567
267
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
} catch (err) {
|
|
577
|
-
_didIteratorError17 = true;
|
|
578
|
-
_iteratorError17 = err;
|
|
579
|
-
} finally {
|
|
580
|
-
try {
|
|
581
|
-
if (!_iteratorNormalCompletion17 && _iterator17.return != null) {
|
|
582
|
-
_iterator17.return();
|
|
583
|
-
}
|
|
584
|
-
} finally {
|
|
585
|
-
if (_didIteratorError17) {
|
|
586
|
-
throw _iteratorError17;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
268
|
+
for (var _i34 = 0, _fieldsDiff$removed4 = fieldsDiff.removed; _i34 < _fieldsDiff$removed4.length; _i34++) {
|
|
269
|
+
var oldField = _fieldsDiff$removed4[_i34];
|
|
270
|
+
schemaChanges.push({
|
|
271
|
+
type: BreakingChangeType.FIELD_REMOVED,
|
|
272
|
+
description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.")
|
|
273
|
+
});
|
|
589
274
|
}
|
|
590
275
|
|
|
591
|
-
var
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
var _ref8 = _step18.value;
|
|
598
|
-
var _oldField2 = _ref8[0];
|
|
599
|
-
var newField = _ref8[1];
|
|
600
|
-
schemaChanges.push.apply(schemaChanges, findArgChanges(oldType, _oldField2, newField));
|
|
601
|
-
var isSafe = isChangeSafeForObjectOrInterfaceField(_oldField2.type, newField.type);
|
|
276
|
+
for (var _i36 = 0, _fieldsDiff$persisted4 = fieldsDiff.persisted; _i36 < _fieldsDiff$persisted4.length; _i36++) {
|
|
277
|
+
var _ref8 = _fieldsDiff$persisted4[_i36];
|
|
278
|
+
var _oldField2 = _ref8[0];
|
|
279
|
+
var newField = _ref8[1];
|
|
280
|
+
schemaChanges.push.apply(schemaChanges, findArgChanges(oldType, _oldField2, newField));
|
|
281
|
+
var isSafe = isChangeSafeForObjectOrInterfaceField(_oldField2.type, newField.type);
|
|
602
282
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
} catch (err) {
|
|
611
|
-
_didIteratorError18 = true;
|
|
612
|
-
_iteratorError18 = err;
|
|
613
|
-
} finally {
|
|
614
|
-
try {
|
|
615
|
-
if (!_iteratorNormalCompletion18 && _iterator18.return != null) {
|
|
616
|
-
_iterator18.return();
|
|
617
|
-
}
|
|
618
|
-
} finally {
|
|
619
|
-
if (_didIteratorError18) {
|
|
620
|
-
throw _iteratorError18;
|
|
621
|
-
}
|
|
283
|
+
if (!isSafe) {
|
|
284
|
+
schemaChanges.push({
|
|
285
|
+
type: BreakingChangeType.FIELD_CHANGED_KIND,
|
|
286
|
+
description: "".concat(oldType.name, ".").concat(_oldField2.name, " changed type from ") + "".concat(String(_oldField2.type), " to ").concat(String(newField.type), ".")
|
|
287
|
+
});
|
|
622
288
|
}
|
|
623
289
|
}
|
|
624
290
|
|
|
@@ -628,115 +294,59 @@ function findFieldChanges(oldType, newType) {
|
|
|
628
294
|
function findArgChanges(oldType, oldField, newField) {
|
|
629
295
|
var schemaChanges = [];
|
|
630
296
|
var argsDiff = diff(oldField.args, newField.args);
|
|
631
|
-
var _iteratorNormalCompletion19 = true;
|
|
632
|
-
var _didIteratorError19 = false;
|
|
633
|
-
var _iteratorError19 = undefined;
|
|
634
297
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
} catch (err) {
|
|
644
|
-
_didIteratorError19 = true;
|
|
645
|
-
_iteratorError19 = err;
|
|
646
|
-
} finally {
|
|
647
|
-
try {
|
|
648
|
-
if (!_iteratorNormalCompletion19 && _iterator19.return != null) {
|
|
649
|
-
_iterator19.return();
|
|
650
|
-
}
|
|
651
|
-
} finally {
|
|
652
|
-
if (_didIteratorError19) {
|
|
653
|
-
throw _iteratorError19;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
298
|
+
for (var _i38 = 0, _argsDiff$removed4 = argsDiff.removed; _i38 < _argsDiff$removed4.length; _i38++) {
|
|
299
|
+
var oldArg = _argsDiff$removed4[_i38];
|
|
300
|
+
schemaChanges.push({
|
|
301
|
+
type: BreakingChangeType.ARG_REMOVED,
|
|
302
|
+
description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(oldArg.name, " was removed.")
|
|
303
|
+
});
|
|
656
304
|
}
|
|
657
305
|
|
|
658
|
-
var
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
for (var _iterator20 = argsDiff.persisted[Symbol.iterator](), _step20; !(_iteratorNormalCompletion20 = (_step20 = _iterator20.next()).done); _iteratorNormalCompletion20 = true) {
|
|
664
|
-
var _ref10 = _step20.value;
|
|
665
|
-
var _oldArg = _ref10[0];
|
|
666
|
-
var newArg = _ref10[1];
|
|
667
|
-
var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldArg.type, newArg.type);
|
|
306
|
+
for (var _i40 = 0, _argsDiff$persisted2 = argsDiff.persisted; _i40 < _argsDiff$persisted2.length; _i40++) {
|
|
307
|
+
var _ref10 = _argsDiff$persisted2[_i40];
|
|
308
|
+
var _oldArg = _ref10[0];
|
|
309
|
+
var newArg = _ref10[1];
|
|
310
|
+
var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldArg.type, newArg.type);
|
|
668
311
|
|
|
669
|
-
|
|
312
|
+
if (!isSafe) {
|
|
313
|
+
schemaChanges.push({
|
|
314
|
+
type: BreakingChangeType.ARG_CHANGED_KIND,
|
|
315
|
+
description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed type from ") + "".concat(String(_oldArg.type), " to ").concat(String(newArg.type), ".")
|
|
316
|
+
});
|
|
317
|
+
} else if (_oldArg.defaultValue !== undefined) {
|
|
318
|
+
if (newArg.defaultValue === undefined) {
|
|
670
319
|
schemaChanges.push({
|
|
671
|
-
type:
|
|
672
|
-
description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, "
|
|
320
|
+
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
|
|
321
|
+
description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " defaultValue was removed.")
|
|
673
322
|
});
|
|
674
|
-
} else
|
|
675
|
-
|
|
323
|
+
} else {
|
|
324
|
+
var oldValueStr = stringifyValue(_oldArg.defaultValue, _oldArg.type);
|
|
325
|
+
var newValueStr = stringifyValue(newArg.defaultValue, newArg.type);
|
|
326
|
+
|
|
327
|
+
if (oldValueStr !== newValueStr) {
|
|
676
328
|
schemaChanges.push({
|
|
677
329
|
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
|
|
678
|
-
description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " defaultValue
|
|
330
|
+
description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed defaultValue from ").concat(oldValueStr, " to ").concat(newValueStr, ".")
|
|
679
331
|
});
|
|
680
|
-
} else {
|
|
681
|
-
var oldValueStr = stringifyValue(_oldArg.defaultValue, _oldArg.type);
|
|
682
|
-
var newValueStr = stringifyValue(newArg.defaultValue, newArg.type);
|
|
683
|
-
|
|
684
|
-
if (oldValueStr !== newValueStr) {
|
|
685
|
-
schemaChanges.push({
|
|
686
|
-
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
|
|
687
|
-
description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed defaultValue from ").concat(oldValueStr, " to ").concat(newValueStr, ".")
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
332
|
}
|
|
691
333
|
}
|
|
692
334
|
}
|
|
693
|
-
} catch (err) {
|
|
694
|
-
_didIteratorError20 = true;
|
|
695
|
-
_iteratorError20 = err;
|
|
696
|
-
} finally {
|
|
697
|
-
try {
|
|
698
|
-
if (!_iteratorNormalCompletion20 && _iterator20.return != null) {
|
|
699
|
-
_iterator20.return();
|
|
700
|
-
}
|
|
701
|
-
} finally {
|
|
702
|
-
if (_didIteratorError20) {
|
|
703
|
-
throw _iteratorError20;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
335
|
}
|
|
707
336
|
|
|
708
|
-
var
|
|
709
|
-
|
|
710
|
-
var _iteratorError21 = undefined;
|
|
711
|
-
|
|
712
|
-
try {
|
|
713
|
-
for (var _iterator21 = argsDiff.added[Symbol.iterator](), _step21; !(_iteratorNormalCompletion21 = (_step21 = _iterator21.next()).done); _iteratorNormalCompletion21 = true) {
|
|
714
|
-
var _newArg = _step21.value;
|
|
337
|
+
for (var _i42 = 0, _argsDiff$added4 = argsDiff.added; _i42 < _argsDiff$added4.length; _i42++) {
|
|
338
|
+
var _newArg = _argsDiff$added4[_i42];
|
|
715
339
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
} catch (err) {
|
|
729
|
-
_didIteratorError21 = true;
|
|
730
|
-
_iteratorError21 = err;
|
|
731
|
-
} finally {
|
|
732
|
-
try {
|
|
733
|
-
if (!_iteratorNormalCompletion21 && _iterator21.return != null) {
|
|
734
|
-
_iterator21.return();
|
|
735
|
-
}
|
|
736
|
-
} finally {
|
|
737
|
-
if (_didIteratorError21) {
|
|
738
|
-
throw _iteratorError21;
|
|
739
|
-
}
|
|
340
|
+
if (isRequiredArgument(_newArg)) {
|
|
341
|
+
schemaChanges.push({
|
|
342
|
+
type: BreakingChangeType.REQUIRED_ARG_ADDED,
|
|
343
|
+
description: "A required arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.")
|
|
344
|
+
});
|
|
345
|
+
} else {
|
|
346
|
+
schemaChanges.push({
|
|
347
|
+
type: DangerousChangeType.OPTIONAL_ARG_ADDED,
|
|
348
|
+
description: "An optional arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.")
|
|
349
|
+
});
|
|
740
350
|
}
|
|
741
351
|
}
|
|
742
352
|
|
|
@@ -801,19 +411,21 @@ function typeKindName(type) {
|
|
|
801
411
|
return 'an Enum type';
|
|
802
412
|
}
|
|
803
413
|
|
|
414
|
+
/* istanbul ignore else */
|
|
804
415
|
if (isInputObjectType(type)) {
|
|
805
416
|
return 'an Input type';
|
|
806
417
|
} // Not reachable. All possible named types have been considered.
|
|
807
418
|
|
|
808
|
-
/* istanbul ignore next */
|
|
809
|
-
|
|
810
419
|
|
|
811
|
-
|
|
420
|
+
/* istanbul ignore next */
|
|
421
|
+
invariant(false, 'Unexpected type: ' + inspect(type));
|
|
812
422
|
}
|
|
813
423
|
|
|
814
424
|
function stringifyValue(value, type) {
|
|
815
425
|
var ast = astFromValue(value, type);
|
|
816
|
-
|
|
426
|
+
|
|
427
|
+
/* istanbul ignore next */
|
|
428
|
+
ast != null || invariant(0);
|
|
817
429
|
return print(ast);
|
|
818
430
|
}
|
|
819
431
|
|
|
@@ -829,60 +441,23 @@ function diff(oldArray, newArray) {
|
|
|
829
441
|
var name = _ref12.name;
|
|
830
442
|
return name;
|
|
831
443
|
});
|
|
832
|
-
var _iteratorNormalCompletion22 = true;
|
|
833
|
-
var _didIteratorError22 = false;
|
|
834
|
-
var _iteratorError22 = undefined;
|
|
835
444
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
var newItem = newMap[oldItem.name];
|
|
445
|
+
for (var _i44 = 0; _i44 < oldArray.length; _i44++) {
|
|
446
|
+
var oldItem = oldArray[_i44];
|
|
447
|
+
var newItem = newMap[oldItem.name];
|
|
840
448
|
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
} catch (err) {
|
|
848
|
-
_didIteratorError22 = true;
|
|
849
|
-
_iteratorError22 = err;
|
|
850
|
-
} finally {
|
|
851
|
-
try {
|
|
852
|
-
if (!_iteratorNormalCompletion22 && _iterator22.return != null) {
|
|
853
|
-
_iterator22.return();
|
|
854
|
-
}
|
|
855
|
-
} finally {
|
|
856
|
-
if (_didIteratorError22) {
|
|
857
|
-
throw _iteratorError22;
|
|
858
|
-
}
|
|
449
|
+
if (newItem === undefined) {
|
|
450
|
+
removed.push(oldItem);
|
|
451
|
+
} else {
|
|
452
|
+
persisted.push([oldItem, newItem]);
|
|
859
453
|
}
|
|
860
454
|
}
|
|
861
455
|
|
|
862
|
-
var
|
|
863
|
-
|
|
864
|
-
var _iteratorError23 = undefined;
|
|
456
|
+
for (var _i46 = 0; _i46 < newArray.length; _i46++) {
|
|
457
|
+
var _newItem = newArray[_i46];
|
|
865
458
|
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
var _newItem = _step23.value;
|
|
869
|
-
|
|
870
|
-
if (oldMap[_newItem.name] === undefined) {
|
|
871
|
-
added.push(_newItem);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
} catch (err) {
|
|
875
|
-
_didIteratorError23 = true;
|
|
876
|
-
_iteratorError23 = err;
|
|
877
|
-
} finally {
|
|
878
|
-
try {
|
|
879
|
-
if (!_iteratorNormalCompletion23 && _iterator23.return != null) {
|
|
880
|
-
_iterator23.return();
|
|
881
|
-
}
|
|
882
|
-
} finally {
|
|
883
|
-
if (_didIteratorError23) {
|
|
884
|
-
throw _iteratorError23;
|
|
885
|
-
}
|
|
459
|
+
if (oldMap[_newItem.name] === undefined) {
|
|
460
|
+
added.push(_newItem);
|
|
886
461
|
}
|
|
887
462
|
}
|
|
888
463
|
|