@graphql-inspector/action
Version:
GraphQL Inspector functionality for GitHub Actions
17 lines (16 loc) • 808 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.changesInScalar = changesInScalar;
const graphql_1 = require("graphql");
const compare_js_1 = require("../utils/compare.js");
const directive_usage_js_1 = require("./changes/directive-usage.js");
function changesInScalar(oldScalar, newScalar, addChange) {
(0, compare_js_1.compareLists)(oldScalar.astNode?.directives || [], newScalar.astNode?.directives || [], {
onAdded(directive) {
addChange((0, directive_usage_js_1.directiveUsageAdded)(graphql_1.Kind.SCALAR_TYPE_DEFINITION, directive, newScalar));
},
onRemoved(directive) {
addChange((0, directive_usage_js_1.directiveUsageRemoved)(graphql_1.Kind.SCALAR_TYPE_DEFINITION, directive, oldScalar));
},
});
}
;