@graphql-inspector/core
Advanced tools
Comparing version 0.13.3 to 1.14.0-rc.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var compare_1 = require("./common/compare"); | ||
var argument_1 = require("./changes/argument"); | ||
var arrays_1 = require("../utils/arrays"); | ||
function changesInArgument(type, field, oldArg, newArg) { | ||
var changes = []; | ||
if (oldArg.description !== newArg.description) { | ||
if (compare_1.notEqual(oldArg.description, newArg.description)) { | ||
changes.push(argument_1.fieldArgumentDescriptionChanged(type, field, oldArg, newArg)); | ||
} | ||
if (oldArg.defaultValue !== newArg.defaultValue) { | ||
changes.push(argument_1.fieldArgumentDefaultChanged(type, field, oldArg, newArg)); | ||
if (compare_1.notEqual(oldArg.defaultValue, newArg.defaultValue)) { | ||
if (Array.isArray(oldArg.defaultValue) && | ||
Array.isArray(newArg.defaultValue)) { | ||
var diff = arrays_1.diffArrays(oldArg.defaultValue, newArg.defaultValue); | ||
if (diff.length > 0) { | ||
changes.push(argument_1.fieldArgumentDefaultChanged(type, field, oldArg, newArg)); | ||
} | ||
} | ||
else if (JSON.stringify(oldArg.defaultValue) !== | ||
JSON.stringify(newArg.defaultValue)) { | ||
changes.push(argument_1.fieldArgumentDefaultChanged(type, field, oldArg, newArg)); | ||
} | ||
} | ||
if (oldArg.type.toString() !== newArg.type.toString()) { | ||
if (compare_1.notEqual(oldArg.type.toString(), newArg.type.toString())) { | ||
changes.push(argument_1.fieldArgumentTypeChanged(type, field, oldArg, newArg)); | ||
@@ -14,0 +26,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var compare_1 = require("./common/compare"); | ||
var directive_1 = require("./changes/directive"); | ||
@@ -7,3 +8,3 @@ var arrays_1 = require("../utils/arrays"); | ||
var changes = []; | ||
if (oldDirective.description !== newDirective.description) { | ||
if (compare_1.notEqual(oldDirective.description, newDirective.description)) { | ||
changes.push(directive_1.directiveDescriptionChanged(oldDirective, newDirective)); | ||
@@ -40,9 +41,9 @@ } | ||
var changes = []; | ||
if (oldArg.description !== newArg.description) { | ||
if (compare_1.notEqual(oldArg.description, newArg.description)) { | ||
changes.push(directive_1.directiveArgumentDescriptionChanged(directive, oldArg, newArg)); | ||
} | ||
if (oldArg.defaultValue !== newArg.defaultValue) { | ||
if (compare_1.notEqual(oldArg.defaultValue, newArg.defaultValue)) { | ||
changes.push(directive_1.directiveArgumentDefaultValueChanged(directive, oldArg, newArg)); | ||
} | ||
if (oldArg.type.toString() !== newArg.type.toString()) { | ||
if (compare_1.notEqual(oldArg.type.toString(), newArg.type.toString())) { | ||
changes.push(directive_1.directiveArgumentTypeChanged(directive, oldArg, newArg)); | ||
@@ -49,0 +50,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var compare_1 = require("./common/compare"); | ||
var enum_1 = require("./changes/enum"); | ||
@@ -19,6 +20,6 @@ var arrays_1 = require("../utils/arrays"); | ||
var oldValue = _a.oldValue, newValue = _a.newValue; | ||
if (oldValue.description !== newValue.description) { | ||
if (compare_1.notEqual(oldValue.description, newValue.description)) { | ||
changes.push(enum_1.enumValueDescriptionChanged(newEnum, oldValue, newValue)); | ||
} | ||
if (oldValue.deprecationReason !== newValue.deprecationReason) { | ||
if (compare_1.notEqual(oldValue.deprecationReason, newValue.deprecationReason)) { | ||
changes.push(enum_1.enumValueDeprecationReasonChanged(newEnum, oldValue, newValue)); | ||
@@ -25,0 +26,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var compare_1 = require("./common/compare"); | ||
var field_1 = require("./changes/field"); | ||
@@ -8,9 +9,9 @@ var argument_1 = require("./argument"); | ||
var changes = []; | ||
if (oldField.description !== newField.description) { | ||
if (compare_1.notEqual(oldField.description, newField.description)) { | ||
changes.push(field_1.fieldDescriptionChanged(type, oldField, newField)); | ||
} | ||
if (oldField.deprecationReason !== newField.deprecationReason) { | ||
if (compare_1.notEqual(oldField.deprecationReason, newField.deprecationReason)) { | ||
changes.push(field_1.fieldDeprecationReasonChanged(type, oldField, newField)); | ||
} | ||
if (oldField.type.toString() !== newField.type.toString()) { | ||
if (compare_1.notEqual(oldField.type.toString(), newField.type.toString())) { | ||
changes.push(field_1.fieldTypeChanged(type, oldField, newField)); | ||
@@ -17,0 +18,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var compare_1 = require("./common/compare"); | ||
var arrays_1 = require("../utils/arrays"); | ||
@@ -28,9 +29,18 @@ var input_1 = require("./changes/input"); | ||
var changes = []; | ||
if (oldField.description !== newField.description) { | ||
if (compare_1.notEqual(oldField.description, newField.description)) { | ||
changes.push(input_1.inputFieldDescriptionChanged(input, oldField, newField)); | ||
} | ||
if (oldField.defaultValue !== newField.defaultValue) { | ||
changes.push(input_1.inputFieldDefaultValueChanged(input, oldField, newField)); | ||
if (compare_1.notEqual(oldField.defaultValue, newField.defaultValue)) { | ||
if (Array.isArray(oldField.defaultValue) && | ||
Array.isArray(newField.defaultValue)) { | ||
if (arrays_1.diffArrays(oldField.defaultValue, newField.defaultValue).length > 0) { | ||
changes.push(input_1.inputFieldDefaultValueChanged(input, oldField, newField)); | ||
} | ||
} | ||
else if (JSON.stringify(oldField.defaultValue) !== | ||
JSON.stringify(newField.defaultValue)) { | ||
changes.push(input_1.inputFieldDefaultValueChanged(input, oldField, newField)); | ||
} | ||
} | ||
if (oldField.type.toString() !== newField.type.toString()) { | ||
if (compare_1.notEqual(oldField.type.toString(), newField.type.toString())) { | ||
changes.push(input_1.inputFieldTypeChanged(input, oldField, newField)); | ||
@@ -37,0 +47,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var graphql_1 = require("graphql"); | ||
var compare_1 = require("./common/compare"); | ||
var arrays_1 = require("../utils/arrays"); | ||
@@ -92,9 +93,9 @@ var graphql_2 = require("../utils/graphql"); | ||
}; | ||
if (oldRoot.query !== newRoot.query) { | ||
if (compare_1.notEqual(oldRoot.query, newRoot.query)) { | ||
changes.push(schema_1.schemaQueryTypeChanged(oldSchema, newSchema)); | ||
} | ||
if (oldRoot.mutation !== newRoot.mutation) { | ||
if (compare_1.notEqual(oldRoot.mutation, newRoot.mutation)) { | ||
changes.push(schema_1.schemaMutationTypeChanged(oldSchema, newSchema)); | ||
} | ||
if (oldRoot.subscription !== newRoot.subscription) { | ||
if (compare_1.notEqual(oldRoot.subscription, newRoot.subscription)) { | ||
changes.push(schema_1.schemaSubscriptionTypeChanged(oldSchema, newSchema)); | ||
@@ -127,3 +128,3 @@ } | ||
} | ||
if (oldType.description !== newType.description) { | ||
if (compare_1.notEqual(oldType.description, newType.description)) { | ||
changes.push(type_1.typeDescriptionChanged(oldType, newType)); | ||
@@ -130,0 +131,0 @@ } |
{ | ||
"name": "@graphql-inspector/core", | ||
"version": "0.13.3", | ||
"version": "1.14.0-rc.0", | ||
"description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.", | ||
@@ -36,9 +36,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/graphql": "14.0.3", | ||
"@types/jest": "23.3.13", | ||
"graphql-tag": "2.10.0", | ||
"jest": "24.0.0", | ||
"ts-jest": "23.10.5", | ||
"typescript": "3.2.2" | ||
"@types/graphql": "14.0.7", | ||
"@types/jest": "24.0.11", | ||
"graphql-tag": "2.10.1", | ||
"jest": "24.5.0", | ||
"ts-jest": "24.0.0", | ||
"typescript": "3.3.3333" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
858900
88
1727