@graphql-inspector/core 7.0.4-alpha-20251126052709-1e9f99e5828f6aaf67924ae5761419279d6539e1 → 7.1.0-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425
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/cjs/diff/changes/argument.js +1 -3
- package/cjs/diff/changes/directive-usage.js +4 -4
- package/cjs/diff/changes/directive.js +2 -6
- package/cjs/diff/changes/field.js +4 -11
- package/cjs/diff/changes/input.js +3 -7
- package/cjs/diff/changes/schema.js +6 -6
- package/cjs/diff/changes/type.js +3 -8
- package/cjs/diff/rules/safe-unreachable.js +1 -1
- package/cjs/diff/rules/suppress-removal-of-deprecated-field.js +4 -4
- package/cjs/diff/schema.js +9 -9
- package/esm/diff/changes/argument.js +2 -4
- package/esm/diff/changes/directive-usage.js +4 -4
- package/esm/diff/changes/directive.js +3 -7
- package/esm/diff/changes/field.js +4 -11
- package/esm/diff/changes/input.js +4 -8
- package/esm/diff/changes/schema.js +6 -6
- package/esm/diff/changes/type.js +3 -8
- package/esm/diff/rules/safe-unreachable.js +1 -1
- package/esm/diff/rules/suppress-removal-of-deprecated-field.js +4 -4
- package/esm/diff/schema.js +11 -11
- package/package.json +1 -1
- package/typings/diff/changes/directive-usage.d.cts +1 -1
- package/typings/diff/changes/directive-usage.d.ts +1 -1
- package/typings/diff/changes/schema.d.cts +3 -3
- package/typings/diff/changes/schema.d.ts +3 -3
- package/typings/diff/index.d.cts +1 -1
- package/typings/diff/index.d.ts +1 -1
- package/typings/diff/rules/types.d.cts +2 -2
- package/typings/diff/rules/types.d.ts +2 -2
- package/typings/diff/schema.d.cts +1 -1
- package/typings/diff/schema.d.ts +1 -1
|
@@ -10,9 +10,7 @@ const graphql_js_1 = require("../../utils/graphql.js");
|
|
|
10
10
|
const string_js_1 = require("../../utils/string.js");
|
|
11
11
|
const change_js_1 = require("./change.js");
|
|
12
12
|
function buildFieldArgumentDescriptionChangedMessage(args) {
|
|
13
|
-
|
|
14
|
-
const newDesc = (0, string_js_1.fmt)(args.newDescription ?? 'undefined');
|
|
15
|
-
return `Description for argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}' changed from '${oldDesc}' to '${newDesc}'`;
|
|
13
|
+
return `Description for argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}' changed from '${args.oldDescription}' to '${args.newDescription}'`;
|
|
16
14
|
}
|
|
17
15
|
function fieldArgumentDescriptionChangedFromMeta(args) {
|
|
18
16
|
return {
|
|
@@ -576,9 +576,9 @@ function directiveUsageAdded(kind, directive, payload, addedToNewType) {
|
|
|
576
576
|
type: change_js_1.ChangeType.DirectiveUsageSchemaAdded,
|
|
577
577
|
meta: {
|
|
578
578
|
addedDirectiveName: directive.name.value,
|
|
579
|
-
schemaTypeName: payload
|
|
579
|
+
schemaTypeName: payload?.getQueryType()?.name || '',
|
|
580
580
|
addedToNewType,
|
|
581
|
-
directiveRepeatedTimes: directiveRepeatTimes(payload
|
|
581
|
+
directiveRepeatedTimes: directiveRepeatTimes(payload?.astNode?.directives ?? [], directive),
|
|
582
582
|
},
|
|
583
583
|
});
|
|
584
584
|
}
|
|
@@ -731,8 +731,8 @@ function directiveUsageRemoved(kind, directive, payload) {
|
|
|
731
731
|
type: change_js_1.ChangeType.DirectiveUsageSchemaRemoved,
|
|
732
732
|
meta: {
|
|
733
733
|
removedDirectiveName: directive.name.value,
|
|
734
|
-
schemaTypeName: payload
|
|
735
|
-
directiveRepeatedTimes: directiveRepeatTimes(payload
|
|
734
|
+
schemaTypeName: payload?.getQueryType()?.name || '',
|
|
735
|
+
directiveRepeatedTimes: directiveRepeatTimes(payload?.astNode?.directives ?? [], directive),
|
|
736
736
|
},
|
|
737
737
|
});
|
|
738
738
|
}
|
|
@@ -78,9 +78,7 @@ function directiveAdded(directive) {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
function buildDirectiveDescriptionChangedMessage(args) {
|
|
81
|
-
|
|
82
|
-
const newDesc = (0, string_js_1.fmt)(args.newDirectiveDescription ?? 'undefined');
|
|
83
|
-
return `Directive '${args.directiveName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
81
|
+
return `Directive '${args.directiveName}' description changed from '${args.oldDirectiveDescription ?? 'undefined'}' to '${args.newDirectiveDescription ?? 'undefined'}'`;
|
|
84
82
|
}
|
|
85
83
|
function directiveDescriptionChangedFromMeta(args) {
|
|
86
84
|
return {
|
|
@@ -260,9 +258,7 @@ function directiveArgumentRemoved(directive, arg) {
|
|
|
260
258
|
});
|
|
261
259
|
}
|
|
262
260
|
function buildDirectiveArgumentDescriptionChangedMessage(args) {
|
|
263
|
-
|
|
264
|
-
const newDesc = (0, string_js_1.fmt)(args.newDirectiveArgumentDescription ?? 'undefined');
|
|
265
|
-
return `Description for argument '${args.directiveArgumentName}' on directive '${args.directiveName}' changed from '${oldDesc}' to '${newDesc}'`;
|
|
261
|
+
return `Description for argument '${args.directiveArgumentName}' on directive '${args.directiveName}' changed from '${args.oldDirectiveArgumentDescription}' to '${args.newDirectiveArgumentDescription}'`;
|
|
266
262
|
}
|
|
267
263
|
function directiveArgumentDescriptionChangedFromMeta(args) {
|
|
268
264
|
return {
|
|
@@ -28,7 +28,6 @@ exports.fieldArgumentRemovedFromMeta = fieldArgumentRemovedFromMeta;
|
|
|
28
28
|
exports.fieldArgumentRemoved = fieldArgumentRemoved;
|
|
29
29
|
const graphql_1 = require("graphql");
|
|
30
30
|
const graphql_js_1 = require("../../utils/graphql.js");
|
|
31
|
-
const string_js_1 = require("../../utils/string.js");
|
|
32
31
|
const change_js_1 = require("./change.js");
|
|
33
32
|
function buildFieldRemovedMessage(args) {
|
|
34
33
|
return `Field '${args.removedFieldName}' ${args.isRemovedFieldDeprecated ? '(deprecated) ' : ''}was removed from ${args.typeType} '${args.typeName}'`;
|
|
@@ -86,9 +85,7 @@ function fieldAdded(type, field) {
|
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
87
|
function buildFieldDescriptionChangedMessage(args) {
|
|
89
|
-
|
|
90
|
-
const newDesc = (0, string_js_1.fmt)(args.newDescription || 'undefined');
|
|
91
|
-
return `Field '${args.typeName}.${args.fieldName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
88
|
+
return `Field '${args.typeName}.${args.fieldName}' description changed from '${args.oldDescription}' to '${args.newDescription}'`;
|
|
92
89
|
}
|
|
93
90
|
function fieldDescriptionChangedFromMeta(args) {
|
|
94
91
|
return {
|
|
@@ -113,8 +110,7 @@ function fieldDescriptionChanged(type, oldField, newField) {
|
|
|
113
110
|
});
|
|
114
111
|
}
|
|
115
112
|
function buildFieldDescriptionAddedMessage(args) {
|
|
116
|
-
|
|
117
|
-
return `Field '${args.typeName}.${args.fieldName}' has description '${desc}'`;
|
|
113
|
+
return `Field '${args.typeName}.${args.fieldName}' has description '${args.addedDescription}'`;
|
|
118
114
|
}
|
|
119
115
|
function fieldDescriptionAddedFromMeta(args) {
|
|
120
116
|
return {
|
|
@@ -205,9 +201,7 @@ function fieldDeprecationRemoved(type, field) {
|
|
|
205
201
|
});
|
|
206
202
|
}
|
|
207
203
|
function buildFieldDeprecationReasonChangedMessage(args) {
|
|
208
|
-
|
|
209
|
-
const newReason = (0, string_js_1.fmt)(args.newDeprecationReason);
|
|
210
|
-
return `Deprecation reason on field '${args.typeName}.${args.fieldName}' has changed from '${oldReason}' to '${newReason}'`;
|
|
204
|
+
return `Deprecation reason on field '${args.typeName}.${args.fieldName}' has changed from '${args.oldDeprecationReason}' to '${args.newDeprecationReason}'`;
|
|
211
205
|
}
|
|
212
206
|
function fieldDeprecationReasonChangedFromMeta(args) {
|
|
213
207
|
return {
|
|
@@ -232,8 +226,7 @@ function fieldDeprecationReasonChanged(type, oldField, newField) {
|
|
|
232
226
|
});
|
|
233
227
|
}
|
|
234
228
|
function buildFieldDeprecationReasonAddedMessage(args) {
|
|
235
|
-
|
|
236
|
-
return `Field '${args.typeName}.${args.fieldName}' has deprecation reason '${reason}'`;
|
|
229
|
+
return `Field '${args.typeName}.${args.fieldName}' has deprecation reason '${args.addedDeprecationReason}'`;
|
|
237
230
|
}
|
|
238
231
|
function fieldDeprecationReasonAddedFromMeta(args) {
|
|
239
232
|
return {
|
|
@@ -82,8 +82,7 @@ function inputFieldAdded(input, field, addedToNewType) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function buildInputFieldDescriptionAddedMessage(args) {
|
|
85
|
-
|
|
86
|
-
return `Input field '${args.inputName}.${args.inputFieldName}' has description '${desc}'`;
|
|
85
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' has description '${args.addedInputFieldDescription}'`;
|
|
87
86
|
}
|
|
88
87
|
function inputFieldDescriptionAddedFromMeta(args) {
|
|
89
88
|
return {
|
|
@@ -107,8 +106,7 @@ function inputFieldDescriptionAdded(type, field) {
|
|
|
107
106
|
});
|
|
108
107
|
}
|
|
109
108
|
function buildInputFieldDescriptionRemovedMessage(args) {
|
|
110
|
-
|
|
111
|
-
return `Description '${desc}' was removed from input field '${args.inputName}.${args.inputFieldName}'`;
|
|
109
|
+
return `Description '${args.removedDescription}' was removed from input field '${args.inputName}.${args.inputFieldName}'`;
|
|
112
110
|
}
|
|
113
111
|
function inputFieldDescriptionRemovedFromMeta(args) {
|
|
114
112
|
return {
|
|
@@ -132,9 +130,7 @@ function inputFieldDescriptionRemoved(type, field) {
|
|
|
132
130
|
});
|
|
133
131
|
}
|
|
134
132
|
function buildInputFieldDescriptionChangedMessage(args) {
|
|
135
|
-
|
|
136
|
-
const newDesc = (0, string_js_1.fmt)(args.newInputFieldDescription);
|
|
137
|
-
return `Input field '${args.inputName}.${args.inputFieldName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
133
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' description changed from '${args.oldInputFieldDescription}' to '${args.newInputFieldDescription}'`;
|
|
138
134
|
}
|
|
139
135
|
function inputFieldDescriptionChangedFromMeta(args) {
|
|
140
136
|
return {
|
|
@@ -23,8 +23,8 @@ function schemaQueryTypeChangedFromMeta(args) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function schemaQueryTypeChanged(oldSchema, newSchema) {
|
|
26
|
-
const oldName = (oldSchema
|
|
27
|
-
const newName = (newSchema
|
|
26
|
+
const oldName = (oldSchema?.getQueryType() || {}).name || 'unknown';
|
|
27
|
+
const newName = (newSchema?.getQueryType() || {}).name || 'unknown';
|
|
28
28
|
return schemaQueryTypeChangedFromMeta({
|
|
29
29
|
type: change_js_1.ChangeType.SchemaQueryTypeChanged,
|
|
30
30
|
meta: {
|
|
@@ -49,8 +49,8 @@ function schemaMutationTypeChangedFromMeta(args) {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
function schemaMutationTypeChanged(oldSchema, newSchema) {
|
|
52
|
-
const oldName = (oldSchema
|
|
53
|
-
const newName = (newSchema
|
|
52
|
+
const oldName = (oldSchema?.getMutationType() || {}).name || 'unknown';
|
|
53
|
+
const newName = (newSchema?.getMutationType() || {}).name || 'unknown';
|
|
54
54
|
return schemaMutationTypeChangedFromMeta({
|
|
55
55
|
type: change_js_1.ChangeType.SchemaMutationTypeChanged,
|
|
56
56
|
meta: {
|
|
@@ -75,8 +75,8 @@ function schemaSubscriptionTypeChangedFromMeta(args) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
function schemaSubscriptionTypeChanged(oldSchema, newSchema) {
|
|
78
|
-
const oldName = (oldSchema
|
|
79
|
-
const newName = (newSchema
|
|
78
|
+
const oldName = (oldSchema?.getSubscriptionType() || {}).name || 'unknown';
|
|
79
|
+
const newName = (newSchema?.getSubscriptionType() || {}).name || 'unknown';
|
|
80
80
|
return schemaSubscriptionTypeChangedFromMeta({
|
|
81
81
|
type: change_js_1.ChangeType.SchemaSubscriptionTypeChanged,
|
|
82
82
|
meta: {
|
package/cjs/diff/changes/type.js
CHANGED
|
@@ -14,7 +14,6 @@ exports.typeDescriptionAddedFromMeta = typeDescriptionAddedFromMeta;
|
|
|
14
14
|
exports.typeDescriptionAdded = typeDescriptionAdded;
|
|
15
15
|
const graphql_1 = require("graphql");
|
|
16
16
|
const graphql_js_1 = require("../../utils/graphql.js");
|
|
17
|
-
const string_js_1 = require("../../utils/string.js");
|
|
18
17
|
const change_js_1 = require("./change.js");
|
|
19
18
|
function buildTypeRemovedMessage(type) {
|
|
20
19
|
return `Type '${type.removedTypeName}' was removed`;
|
|
@@ -115,9 +114,7 @@ function typeKindChanged(oldType, newType) {
|
|
|
115
114
|
});
|
|
116
115
|
}
|
|
117
116
|
function buildTypeDescriptionChangedMessage(args) {
|
|
118
|
-
|
|
119
|
-
const newDesc = (0, string_js_1.fmt)(args.newTypeDescription);
|
|
120
|
-
return `Description '${oldDesc}' on type '${args.typeName}' has changed to '${newDesc}'`;
|
|
117
|
+
return `Description '${args.oldTypeDescription}' on type '${args.typeName}' has changed to '${args.newTypeDescription}'`;
|
|
121
118
|
}
|
|
122
119
|
function typeDescriptionChangedFromMeta(args) {
|
|
123
120
|
return {
|
|
@@ -141,8 +138,7 @@ function typeDescriptionChanged(oldType, newType) {
|
|
|
141
138
|
});
|
|
142
139
|
}
|
|
143
140
|
function buildTypeDescriptionRemoved(args) {
|
|
144
|
-
|
|
145
|
-
return `Description '${desc}' was removed from object type '${args.typeName}'`;
|
|
141
|
+
return `Description '${args.removedTypeDescription}' was removed from object type '${args.typeName}'`;
|
|
146
142
|
}
|
|
147
143
|
function typeDescriptionRemovedFromMeta(args) {
|
|
148
144
|
return {
|
|
@@ -165,8 +161,7 @@ function typeDescriptionRemoved(type) {
|
|
|
165
161
|
});
|
|
166
162
|
}
|
|
167
163
|
function buildTypeDescriptionAddedMessage(args) {
|
|
168
|
-
|
|
169
|
-
return `Object type '${args.typeName}' has description '${desc}'`;
|
|
164
|
+
return `Object type '${args.typeName}' has description '${args.addedTypeDescription}'`;
|
|
170
165
|
}
|
|
171
166
|
function typeDescriptionAddedFromMeta(args) {
|
|
172
167
|
return {
|
|
@@ -5,7 +5,7 @@ const graphql_js_1 = require("../../utils/graphql.js");
|
|
|
5
5
|
const path_js_1 = require("../../utils/path.js");
|
|
6
6
|
const change_js_1 = require("../changes/change.js");
|
|
7
7
|
const safeUnreachable = ({ changes, oldSchema }) => {
|
|
8
|
-
const reachable = (0, graphql_js_1.getReachableTypes)(oldSchema);
|
|
8
|
+
const reachable = oldSchema ? (0, graphql_js_1.getReachableTypes)(oldSchema) : new Set();
|
|
9
9
|
return changes.map(change => {
|
|
10
10
|
if (change.criticality.level === change_js_1.CriticalityLevel.Breaking && change.path) {
|
|
11
11
|
const [typeName] = (0, path_js_1.parsePath)(change.path);
|
|
@@ -11,7 +11,7 @@ const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema }) =>
|
|
|
11
11
|
change.criticality.level === change_js_1.CriticalityLevel.Breaking &&
|
|
12
12
|
change.path) {
|
|
13
13
|
const [typeName, fieldName] = (0, path_js_1.parsePath)(change.path);
|
|
14
|
-
const type = oldSchema
|
|
14
|
+
const type = oldSchema?.getType(typeName);
|
|
15
15
|
if ((0, graphql_1.isObjectType)(type) || (0, graphql_1.isInterfaceType)(type)) {
|
|
16
16
|
const field = type.getFields()[fieldName];
|
|
17
17
|
if ((0, is_deprecated_js_1.isDeprecated)(field)) {
|
|
@@ -29,7 +29,7 @@ const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema }) =>
|
|
|
29
29
|
change.criticality.level === change_js_1.CriticalityLevel.Breaking &&
|
|
30
30
|
change.path) {
|
|
31
31
|
const [enumName, enumItem] = (0, path_js_1.parsePath)(change.path);
|
|
32
|
-
const type = oldSchema
|
|
32
|
+
const type = oldSchema?.getType(enumName);
|
|
33
33
|
if ((0, graphql_1.isEnumType)(type)) {
|
|
34
34
|
const item = type.getValue(enumItem);
|
|
35
35
|
if (item && (0, is_deprecated_js_1.isDeprecated)(item)) {
|
|
@@ -47,7 +47,7 @@ const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema }) =>
|
|
|
47
47
|
change.criticality.level === change_js_1.CriticalityLevel.Breaking &&
|
|
48
48
|
change.path) {
|
|
49
49
|
const [inputName, inputItem] = (0, path_js_1.parsePath)(change.path);
|
|
50
|
-
const type = oldSchema
|
|
50
|
+
const type = oldSchema?.getType(inputName);
|
|
51
51
|
if ((0, graphql_1.isInputObjectType)(type)) {
|
|
52
52
|
const item = type.getFields()[inputItem];
|
|
53
53
|
if (item && (0, is_deprecated_js_1.isDeprecated)(item)) {
|
|
@@ -65,7 +65,7 @@ const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema }) =>
|
|
|
65
65
|
change.criticality.level === change_js_1.CriticalityLevel.Breaking &&
|
|
66
66
|
change.path) {
|
|
67
67
|
const [typeName] = (0, path_js_1.parsePath)(change.path);
|
|
68
|
-
const type = newSchema
|
|
68
|
+
const type = newSchema?.getType(typeName);
|
|
69
69
|
if (!type) {
|
|
70
70
|
return {
|
|
71
71
|
...change,
|
package/cjs/diff/schema.js
CHANGED
|
@@ -21,7 +21,7 @@ function diffSchema(oldSchema, newSchema) {
|
|
|
21
21
|
changes.push(change);
|
|
22
22
|
}
|
|
23
23
|
changesInSchema(oldSchema, newSchema, addChange);
|
|
24
|
-
(0, compare_js_1.compareLists)(Object.values(oldSchema
|
|
24
|
+
(0, compare_js_1.compareLists)(Object.values(oldSchema?.getTypeMap() ?? {}).filter(t => !(0, graphql_js_1.isPrimitive)(t) && !(0, graphql_js_1.isForIntrospection)(t)), Object.values(newSchema?.getTypeMap() ?? {}).filter(t => !(0, graphql_js_1.isPrimitive)(t) && !(0, graphql_js_1.isForIntrospection)(t)), {
|
|
25
25
|
onAdded(type) {
|
|
26
26
|
addChange((0, type_js_1.typeAdded)(type));
|
|
27
27
|
changesInType(null, type, addChange);
|
|
@@ -33,7 +33,7 @@ function diffSchema(oldSchema, newSchema) {
|
|
|
33
33
|
changesInType(type.oldVersion, type.newVersion, addChange);
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
|
-
(0, compare_js_1.compareLists)(oldSchema
|
|
36
|
+
(0, compare_js_1.compareLists)((oldSchema?.getDirectives() ?? []).filter(t => !(0, graphql_1.isSpecifiedDirective)(t)), (newSchema?.getDirectives() ?? []).filter(t => !(0, graphql_1.isSpecifiedDirective)(t)), {
|
|
37
37
|
onAdded(directive) {
|
|
38
38
|
addChange((0, directive_js_1.directiveAdded)(directive));
|
|
39
39
|
(0, directive_js_2.changesInDirective)(null, directive, addChange);
|
|
@@ -45,7 +45,7 @@ function diffSchema(oldSchema, newSchema) {
|
|
|
45
45
|
(0, directive_js_2.changesInDirective)(directive.oldVersion, directive.newVersion, addChange);
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
(0, compare_js_1.compareDirectiveLists)(oldSchema
|
|
48
|
+
(0, compare_js_1.compareDirectiveLists)(oldSchema?.astNode?.directives || [], newSchema?.astNode?.directives || [], {
|
|
49
49
|
onAdded(directive) {
|
|
50
50
|
addChange((0, directive_usage_js_1.directiveUsageAdded)(graphql_1.Kind.SCHEMA_DEFINITION, directive, newSchema, false));
|
|
51
51
|
(0, directive_usage_js_1.directiveUsageChanged)(null, directive, addChange);
|
|
@@ -61,14 +61,14 @@ function diffSchema(oldSchema, newSchema) {
|
|
|
61
61
|
}
|
|
62
62
|
function changesInSchema(oldSchema, newSchema, addChange) {
|
|
63
63
|
const oldRoot = {
|
|
64
|
-
query: (oldSchema
|
|
65
|
-
mutation: (oldSchema
|
|
66
|
-
subscription: (oldSchema
|
|
64
|
+
query: (oldSchema?.getQueryType() || {}).name,
|
|
65
|
+
mutation: (oldSchema?.getMutationType() || {}).name,
|
|
66
|
+
subscription: (oldSchema?.getSubscriptionType() || {}).name,
|
|
67
67
|
};
|
|
68
68
|
const newRoot = {
|
|
69
|
-
query: (newSchema
|
|
70
|
-
mutation: (newSchema
|
|
71
|
-
subscription: (newSchema
|
|
69
|
+
query: (newSchema?.getQueryType() || {}).name,
|
|
70
|
+
mutation: (newSchema?.getMutationType() || {}).name,
|
|
71
|
+
subscription: (newSchema?.getSubscriptionType() || {}).name,
|
|
72
72
|
};
|
|
73
73
|
if ((0, compare_js_1.isNotEqual)(oldRoot.query, newRoot.query)) {
|
|
74
74
|
addChange((0, schema_js_1.schemaQueryTypeChanged)(oldSchema, newSchema));
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { safeChangeForInputValue } from '../../utils/graphql.js';
|
|
2
|
-
import {
|
|
2
|
+
import { safeString } from '../../utils/string.js';
|
|
3
3
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
4
4
|
function buildFieldArgumentDescriptionChangedMessage(args) {
|
|
5
|
-
|
|
6
|
-
const newDesc = fmt(args.newDescription ?? 'undefined');
|
|
7
|
-
return `Description for argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}' changed from '${oldDesc}' to '${newDesc}'`;
|
|
5
|
+
return `Description for argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}' changed from '${args.oldDescription}' to '${args.newDescription}'`;
|
|
8
6
|
}
|
|
9
7
|
export function fieldArgumentDescriptionChangedFromMeta(args) {
|
|
10
8
|
return {
|
|
@@ -545,9 +545,9 @@ export function directiveUsageAdded(kind, directive, payload, addedToNewType) {
|
|
|
545
545
|
type: ChangeType.DirectiveUsageSchemaAdded,
|
|
546
546
|
meta: {
|
|
547
547
|
addedDirectiveName: directive.name.value,
|
|
548
|
-
schemaTypeName: payload
|
|
548
|
+
schemaTypeName: payload?.getQueryType()?.name || '',
|
|
549
549
|
addedToNewType,
|
|
550
|
-
directiveRepeatedTimes: directiveRepeatTimes(payload
|
|
550
|
+
directiveRepeatedTimes: directiveRepeatTimes(payload?.astNode?.directives ?? [], directive),
|
|
551
551
|
},
|
|
552
552
|
});
|
|
553
553
|
}
|
|
@@ -700,8 +700,8 @@ export function directiveUsageRemoved(kind, directive, payload) {
|
|
|
700
700
|
type: ChangeType.DirectiveUsageSchemaRemoved,
|
|
701
701
|
meta: {
|
|
702
702
|
removedDirectiveName: directive.name.value,
|
|
703
|
-
schemaTypeName: payload
|
|
704
|
-
directiveRepeatedTimes: directiveRepeatTimes(payload
|
|
703
|
+
schemaTypeName: payload?.getQueryType()?.name || '',
|
|
704
|
+
directiveRepeatedTimes: directiveRepeatTimes(payload?.astNode?.directives ?? [], directive),
|
|
705
705
|
},
|
|
706
706
|
});
|
|
707
707
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNonNullType } from 'graphql';
|
|
2
2
|
import { safeChangeForInputValue } from '../../utils/graphql.js';
|
|
3
|
-
import {
|
|
3
|
+
import { safeString } from '../../utils/string.js';
|
|
4
4
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
5
5
|
function buildDirectiveRemovedMessage(args) {
|
|
6
6
|
return `Directive '${args.removedDirectiveName}' was removed`;
|
|
@@ -52,9 +52,7 @@ export function directiveAdded(directive) {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function buildDirectiveDescriptionChangedMessage(args) {
|
|
55
|
-
|
|
56
|
-
const newDesc = fmt(args.newDirectiveDescription ?? 'undefined');
|
|
57
|
-
return `Directive '${args.directiveName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
55
|
+
return `Directive '${args.directiveName}' description changed from '${args.oldDirectiveDescription ?? 'undefined'}' to '${args.newDirectiveDescription ?? 'undefined'}'`;
|
|
58
56
|
}
|
|
59
57
|
export function directiveDescriptionChangedFromMeta(args) {
|
|
60
58
|
return {
|
|
@@ -234,9 +232,7 @@ export function directiveArgumentRemoved(directive, arg) {
|
|
|
234
232
|
});
|
|
235
233
|
}
|
|
236
234
|
function buildDirectiveArgumentDescriptionChangedMessage(args) {
|
|
237
|
-
|
|
238
|
-
const newDesc = fmt(args.newDirectiveArgumentDescription ?? 'undefined');
|
|
239
|
-
return `Description for argument '${args.directiveArgumentName}' on directive '${args.directiveName}' changed from '${oldDesc}' to '${newDesc}'`;
|
|
235
|
+
return `Description for argument '${args.directiveArgumentName}' on directive '${args.directiveName}' changed from '${args.oldDirectiveArgumentDescription}' to '${args.newDirectiveArgumentDescription}'`;
|
|
240
236
|
}
|
|
241
237
|
export function directiveArgumentDescriptionChangedFromMeta(args) {
|
|
242
238
|
return {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GraphQLDeprecatedDirective, isInterfaceType, isNonNullType, } from 'graphql';
|
|
2
2
|
import { safeChangeForField } from '../../utils/graphql.js';
|
|
3
|
-
import { fmt } from '../../utils/string.js';
|
|
4
3
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
5
4
|
function buildFieldRemovedMessage(args) {
|
|
6
5
|
return `Field '${args.removedFieldName}' ${args.isRemovedFieldDeprecated ? '(deprecated) ' : ''}was removed from ${args.typeType} '${args.typeName}'`;
|
|
@@ -58,9 +57,7 @@ export function fieldAdded(type, field) {
|
|
|
58
57
|
});
|
|
59
58
|
}
|
|
60
59
|
function buildFieldDescriptionChangedMessage(args) {
|
|
61
|
-
|
|
62
|
-
const newDesc = fmt(args.newDescription || 'undefined');
|
|
63
|
-
return `Field '${args.typeName}.${args.fieldName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
60
|
+
return `Field '${args.typeName}.${args.fieldName}' description changed from '${args.oldDescription}' to '${args.newDescription}'`;
|
|
64
61
|
}
|
|
65
62
|
export function fieldDescriptionChangedFromMeta(args) {
|
|
66
63
|
return {
|
|
@@ -85,8 +82,7 @@ export function fieldDescriptionChanged(type, oldField, newField) {
|
|
|
85
82
|
});
|
|
86
83
|
}
|
|
87
84
|
function buildFieldDescriptionAddedMessage(args) {
|
|
88
|
-
|
|
89
|
-
return `Field '${args.typeName}.${args.fieldName}' has description '${desc}'`;
|
|
85
|
+
return `Field '${args.typeName}.${args.fieldName}' has description '${args.addedDescription}'`;
|
|
90
86
|
}
|
|
91
87
|
export function fieldDescriptionAddedFromMeta(args) {
|
|
92
88
|
return {
|
|
@@ -177,9 +173,7 @@ export function fieldDeprecationRemoved(type, field) {
|
|
|
177
173
|
});
|
|
178
174
|
}
|
|
179
175
|
function buildFieldDeprecationReasonChangedMessage(args) {
|
|
180
|
-
|
|
181
|
-
const newReason = fmt(args.newDeprecationReason);
|
|
182
|
-
return `Deprecation reason on field '${args.typeName}.${args.fieldName}' has changed from '${oldReason}' to '${newReason}'`;
|
|
176
|
+
return `Deprecation reason on field '${args.typeName}.${args.fieldName}' has changed from '${args.oldDeprecationReason}' to '${args.newDeprecationReason}'`;
|
|
183
177
|
}
|
|
184
178
|
export function fieldDeprecationReasonChangedFromMeta(args) {
|
|
185
179
|
return {
|
|
@@ -204,8 +198,7 @@ export function fieldDeprecationReasonChanged(type, oldField, newField) {
|
|
|
204
198
|
});
|
|
205
199
|
}
|
|
206
200
|
function buildFieldDeprecationReasonAddedMessage(args) {
|
|
207
|
-
|
|
208
|
-
return `Field '${args.typeName}.${args.fieldName}' has deprecation reason '${reason}'`;
|
|
201
|
+
return `Field '${args.typeName}.${args.fieldName}' has deprecation reason '${args.addedDeprecationReason}'`;
|
|
209
202
|
}
|
|
210
203
|
export function fieldDeprecationReasonAddedFromMeta(args) {
|
|
211
204
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isNonNullType } from 'graphql';
|
|
2
2
|
import { safeChangeForInputValue } from '../../utils/graphql.js';
|
|
3
3
|
import { isDeprecated } from '../../utils/is-deprecated.js';
|
|
4
|
-
import {
|
|
4
|
+
import { safeString } from '../../utils/string.js';
|
|
5
5
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
6
6
|
function buildInputFieldRemovedMessage(args) {
|
|
7
7
|
return `Input field '${args.removedFieldName}' ${args.isInputFieldDeprecated ? '(deprecated) ' : ''}was removed from input object type '${args.inputName}'`;
|
|
@@ -65,8 +65,7 @@ export function inputFieldAdded(input, field, addedToNewType) {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function buildInputFieldDescriptionAddedMessage(args) {
|
|
68
|
-
|
|
69
|
-
return `Input field '${args.inputName}.${args.inputFieldName}' has description '${desc}'`;
|
|
68
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' has description '${args.addedInputFieldDescription}'`;
|
|
70
69
|
}
|
|
71
70
|
export function inputFieldDescriptionAddedFromMeta(args) {
|
|
72
71
|
return {
|
|
@@ -90,8 +89,7 @@ export function inputFieldDescriptionAdded(type, field) {
|
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
91
|
function buildInputFieldDescriptionRemovedMessage(args) {
|
|
93
|
-
|
|
94
|
-
return `Description '${desc}' was removed from input field '${args.inputName}.${args.inputFieldName}'`;
|
|
92
|
+
return `Description '${args.removedDescription}' was removed from input field '${args.inputName}.${args.inputFieldName}'`;
|
|
95
93
|
}
|
|
96
94
|
export function inputFieldDescriptionRemovedFromMeta(args) {
|
|
97
95
|
return {
|
|
@@ -115,9 +113,7 @@ export function inputFieldDescriptionRemoved(type, field) {
|
|
|
115
113
|
});
|
|
116
114
|
}
|
|
117
115
|
function buildInputFieldDescriptionChangedMessage(args) {
|
|
118
|
-
|
|
119
|
-
const newDesc = fmt(args.newInputFieldDescription);
|
|
120
|
-
return `Input field '${args.inputName}.${args.inputFieldName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
116
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' description changed from '${args.oldInputFieldDescription}' to '${args.newInputFieldDescription}'`;
|
|
121
117
|
}
|
|
122
118
|
export function inputFieldDescriptionChangedFromMeta(args) {
|
|
123
119
|
return {
|
|
@@ -15,8 +15,8 @@ export function schemaQueryTypeChangedFromMeta(args) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export function schemaQueryTypeChanged(oldSchema, newSchema) {
|
|
18
|
-
const oldName = (oldSchema
|
|
19
|
-
const newName = (newSchema
|
|
18
|
+
const oldName = (oldSchema?.getQueryType() || {}).name || 'unknown';
|
|
19
|
+
const newName = (newSchema?.getQueryType() || {}).name || 'unknown';
|
|
20
20
|
return schemaQueryTypeChangedFromMeta({
|
|
21
21
|
type: ChangeType.SchemaQueryTypeChanged,
|
|
22
22
|
meta: {
|
|
@@ -41,8 +41,8 @@ export function schemaMutationTypeChangedFromMeta(args) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
export function schemaMutationTypeChanged(oldSchema, newSchema) {
|
|
44
|
-
const oldName = (oldSchema
|
|
45
|
-
const newName = (newSchema
|
|
44
|
+
const oldName = (oldSchema?.getMutationType() || {}).name || 'unknown';
|
|
45
|
+
const newName = (newSchema?.getMutationType() || {}).name || 'unknown';
|
|
46
46
|
return schemaMutationTypeChangedFromMeta({
|
|
47
47
|
type: ChangeType.SchemaMutationTypeChanged,
|
|
48
48
|
meta: {
|
|
@@ -67,8 +67,8 @@ export function schemaSubscriptionTypeChangedFromMeta(args) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
export function schemaSubscriptionTypeChanged(oldSchema, newSchema) {
|
|
70
|
-
const oldName = (oldSchema
|
|
71
|
-
const newName = (newSchema
|
|
70
|
+
const oldName = (oldSchema?.getSubscriptionType() || {}).name || 'unknown';
|
|
71
|
+
const newName = (newSchema?.getSubscriptionType() || {}).name || 'unknown';
|
|
72
72
|
return schemaSubscriptionTypeChangedFromMeta({
|
|
73
73
|
type: ChangeType.SchemaSubscriptionTypeChanged,
|
|
74
74
|
meta: {
|
package/esm/diff/changes/type.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, isUnionType, Kind, } from 'graphql';
|
|
2
2
|
import { getKind } from '../../utils/graphql.js';
|
|
3
|
-
import { fmt } from '../../utils/string.js';
|
|
4
3
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
5
4
|
function buildTypeRemovedMessage(type) {
|
|
6
5
|
return `Type '${type.removedTypeName}' was removed`;
|
|
@@ -101,9 +100,7 @@ export function typeKindChanged(oldType, newType) {
|
|
|
101
100
|
});
|
|
102
101
|
}
|
|
103
102
|
function buildTypeDescriptionChangedMessage(args) {
|
|
104
|
-
|
|
105
|
-
const newDesc = fmt(args.newTypeDescription);
|
|
106
|
-
return `Description '${oldDesc}' on type '${args.typeName}' has changed to '${newDesc}'`;
|
|
103
|
+
return `Description '${args.oldTypeDescription}' on type '${args.typeName}' has changed to '${args.newTypeDescription}'`;
|
|
107
104
|
}
|
|
108
105
|
export function typeDescriptionChangedFromMeta(args) {
|
|
109
106
|
return {
|
|
@@ -127,8 +124,7 @@ export function typeDescriptionChanged(oldType, newType) {
|
|
|
127
124
|
});
|
|
128
125
|
}
|
|
129
126
|
function buildTypeDescriptionRemoved(args) {
|
|
130
|
-
|
|
131
|
-
return `Description '${desc}' was removed from object type '${args.typeName}'`;
|
|
127
|
+
return `Description '${args.removedTypeDescription}' was removed from object type '${args.typeName}'`;
|
|
132
128
|
}
|
|
133
129
|
export function typeDescriptionRemovedFromMeta(args) {
|
|
134
130
|
return {
|
|
@@ -151,8 +147,7 @@ export function typeDescriptionRemoved(type) {
|
|
|
151
147
|
});
|
|
152
148
|
}
|
|
153
149
|
function buildTypeDescriptionAddedMessage(args) {
|
|
154
|
-
|
|
155
|
-
return `Object type '${args.typeName}' has description '${desc}'`;
|
|
150
|
+
return `Object type '${args.typeName}' has description '${args.addedTypeDescription}'`;
|
|
156
151
|
}
|
|
157
152
|
export function typeDescriptionAddedFromMeta(args) {
|
|
158
153
|
return {
|
|
@@ -2,7 +2,7 @@ import { getReachableTypes } from '../../utils/graphql.js';
|
|
|
2
2
|
import { parsePath } from '../../utils/path.js';
|
|
3
3
|
import { CriticalityLevel } from '../changes/change.js';
|
|
4
4
|
export const safeUnreachable = ({ changes, oldSchema }) => {
|
|
5
|
-
const reachable = getReachableTypes(oldSchema);
|
|
5
|
+
const reachable = oldSchema ? getReachableTypes(oldSchema) : new Set();
|
|
6
6
|
return changes.map(change => {
|
|
7
7
|
if (change.criticality.level === CriticalityLevel.Breaking && change.path) {
|
|
8
8
|
const [typeName] = parsePath(change.path);
|
|
@@ -8,7 +8,7 @@ export const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema
|
|
|
8
8
|
change.criticality.level === CriticalityLevel.Breaking &&
|
|
9
9
|
change.path) {
|
|
10
10
|
const [typeName, fieldName] = parsePath(change.path);
|
|
11
|
-
const type = oldSchema
|
|
11
|
+
const type = oldSchema?.getType(typeName);
|
|
12
12
|
if (isObjectType(type) || isInterfaceType(type)) {
|
|
13
13
|
const field = type.getFields()[fieldName];
|
|
14
14
|
if (isDeprecated(field)) {
|
|
@@ -26,7 +26,7 @@ export const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema
|
|
|
26
26
|
change.criticality.level === CriticalityLevel.Breaking &&
|
|
27
27
|
change.path) {
|
|
28
28
|
const [enumName, enumItem] = parsePath(change.path);
|
|
29
|
-
const type = oldSchema
|
|
29
|
+
const type = oldSchema?.getType(enumName);
|
|
30
30
|
if (isEnumType(type)) {
|
|
31
31
|
const item = type.getValue(enumItem);
|
|
32
32
|
if (item && isDeprecated(item)) {
|
|
@@ -44,7 +44,7 @@ export const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema
|
|
|
44
44
|
change.criticality.level === CriticalityLevel.Breaking &&
|
|
45
45
|
change.path) {
|
|
46
46
|
const [inputName, inputItem] = parsePath(change.path);
|
|
47
|
-
const type = oldSchema
|
|
47
|
+
const type = oldSchema?.getType(inputName);
|
|
48
48
|
if (isInputObjectType(type)) {
|
|
49
49
|
const item = type.getFields()[inputItem];
|
|
50
50
|
if (item && isDeprecated(item)) {
|
|
@@ -62,7 +62,7 @@ export const suppressRemovalOfDeprecatedField = ({ changes, oldSchema, newSchema
|
|
|
62
62
|
change.criticality.level === CriticalityLevel.Breaking &&
|
|
63
63
|
change.path) {
|
|
64
64
|
const [typeName] = parsePath(change.path);
|
|
65
|
-
const type = newSchema
|
|
65
|
+
const type = newSchema?.getType(typeName);
|
|
66
66
|
if (!type) {
|
|
67
67
|
return {
|
|
68
68
|
...change,
|
package/esm/diff/schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isUnionType, Kind, } from 'graphql';
|
|
1
|
+
import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isSpecifiedDirective, isUnionType, Kind, } from 'graphql';
|
|
2
2
|
import { compareDirectiveLists, compareLists, isNotEqual, isVoid } from '../utils/compare.js';
|
|
3
|
-
import { isPrimitive } from '../utils/graphql.js';
|
|
3
|
+
import { isForIntrospection, isPrimitive } from '../utils/graphql.js';
|
|
4
4
|
import { directiveUsageAdded, directiveUsageChanged, directiveUsageRemoved, } from './changes/directive-usage.js';
|
|
5
5
|
import { directiveAdded, directiveRemoved } from './changes/directive.js';
|
|
6
6
|
import { schemaMutationTypeChanged, schemaQueryTypeChanged, schemaSubscriptionTypeChanged, } from './changes/schema.js';
|
|
@@ -18,7 +18,7 @@ export function diffSchema(oldSchema, newSchema) {
|
|
|
18
18
|
changes.push(change);
|
|
19
19
|
}
|
|
20
20
|
changesInSchema(oldSchema, newSchema, addChange);
|
|
21
|
-
compareLists(Object.values(oldSchema
|
|
21
|
+
compareLists(Object.values(oldSchema?.getTypeMap() ?? {}).filter(t => !isPrimitive(t) && !isForIntrospection(t)), Object.values(newSchema?.getTypeMap() ?? {}).filter(t => !isPrimitive(t) && !isForIntrospection(t)), {
|
|
22
22
|
onAdded(type) {
|
|
23
23
|
addChange(typeAdded(type));
|
|
24
24
|
changesInType(null, type, addChange);
|
|
@@ -30,7 +30,7 @@ export function diffSchema(oldSchema, newSchema) {
|
|
|
30
30
|
changesInType(type.oldVersion, type.newVersion, addChange);
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
compareLists(oldSchema
|
|
33
|
+
compareLists((oldSchema?.getDirectives() ?? []).filter(t => !isSpecifiedDirective(t)), (newSchema?.getDirectives() ?? []).filter(t => !isSpecifiedDirective(t)), {
|
|
34
34
|
onAdded(directive) {
|
|
35
35
|
addChange(directiveAdded(directive));
|
|
36
36
|
changesInDirective(null, directive, addChange);
|
|
@@ -42,7 +42,7 @@ export function diffSchema(oldSchema, newSchema) {
|
|
|
42
42
|
changesInDirective(directive.oldVersion, directive.newVersion, addChange);
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
|
-
compareDirectiveLists(oldSchema
|
|
45
|
+
compareDirectiveLists(oldSchema?.astNode?.directives || [], newSchema?.astNode?.directives || [], {
|
|
46
46
|
onAdded(directive) {
|
|
47
47
|
addChange(directiveUsageAdded(Kind.SCHEMA_DEFINITION, directive, newSchema, false));
|
|
48
48
|
directiveUsageChanged(null, directive, addChange);
|
|
@@ -58,14 +58,14 @@ export function diffSchema(oldSchema, newSchema) {
|
|
|
58
58
|
}
|
|
59
59
|
function changesInSchema(oldSchema, newSchema, addChange) {
|
|
60
60
|
const oldRoot = {
|
|
61
|
-
query: (oldSchema
|
|
62
|
-
mutation: (oldSchema
|
|
63
|
-
subscription: (oldSchema
|
|
61
|
+
query: (oldSchema?.getQueryType() || {}).name,
|
|
62
|
+
mutation: (oldSchema?.getMutationType() || {}).name,
|
|
63
|
+
subscription: (oldSchema?.getSubscriptionType() || {}).name,
|
|
64
64
|
};
|
|
65
65
|
const newRoot = {
|
|
66
|
-
query: (newSchema
|
|
67
|
-
mutation: (newSchema
|
|
68
|
-
subscription: (newSchema
|
|
66
|
+
query: (newSchema?.getQueryType() || {}).name,
|
|
67
|
+
mutation: (newSchema?.getMutationType() || {}).name,
|
|
68
|
+
subscription: (newSchema?.getSubscriptionType() || {}).name,
|
|
69
69
|
};
|
|
70
70
|
if (isNotEqual(oldRoot.query, newRoot.query)) {
|
|
71
71
|
addChange(schemaQueryTypeChanged(oldSchema, newSchema));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-inspector/core",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425",
|
|
4
4
|
"description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -32,7 +32,7 @@ type KindToPayload = {
|
|
|
32
32
|
change: DirectiveUsageEnumValueAddedChange | DirectiveUsageEnumValueRemovedChange;
|
|
33
33
|
};
|
|
34
34
|
[Kind.SCHEMA_DEFINITION]: {
|
|
35
|
-
input: GraphQLSchema;
|
|
35
|
+
input: GraphQLSchema | null;
|
|
36
36
|
change: DirectiveUsageSchemaAddedChange | DirectiveUsageSchemaRemovedChange;
|
|
37
37
|
};
|
|
38
38
|
[Kind.SCALAR_TYPE_DEFINITION]: {
|
|
@@ -32,7 +32,7 @@ type KindToPayload = {
|
|
|
32
32
|
change: DirectiveUsageEnumValueAddedChange | DirectiveUsageEnumValueRemovedChange;
|
|
33
33
|
};
|
|
34
34
|
[Kind.SCHEMA_DEFINITION]: {
|
|
35
|
-
input: GraphQLSchema;
|
|
35
|
+
input: GraphQLSchema | null;
|
|
36
36
|
change: DirectiveUsageSchemaAddedChange | DirectiveUsageSchemaRemovedChange;
|
|
37
37
|
};
|
|
38
38
|
[Kind.SCALAR_TYPE_DEFINITION]: {
|
|
@@ -11,7 +11,7 @@ export declare function schemaQueryTypeChangedFromMeta(args: SchemaQueryTypeChan
|
|
|
11
11
|
newQueryTypeName: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export declare function schemaQueryTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change<typeof ChangeType.SchemaQueryTypeChanged>;
|
|
14
|
+
export declare function schemaQueryTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaQueryTypeChanged>;
|
|
15
15
|
export declare function schemaMutationTypeChangedFromMeta(args: SchemaMutationTypeChangedChange): {
|
|
16
16
|
readonly type: "SCHEMA_MUTATION_TYPE_CHANGED";
|
|
17
17
|
readonly criticality: {
|
|
@@ -23,7 +23,7 @@ export declare function schemaMutationTypeChangedFromMeta(args: SchemaMutationTy
|
|
|
23
23
|
newMutationTypeName: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
export declare function schemaMutationTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change<typeof ChangeType.SchemaMutationTypeChanged>;
|
|
26
|
+
export declare function schemaMutationTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaMutationTypeChanged>;
|
|
27
27
|
export declare function schemaSubscriptionTypeChangedFromMeta(args: SchemaSubscriptionTypeChangedChange): {
|
|
28
28
|
readonly type: "SCHEMA_SUBSCRIPTION_TYPE_CHANGED";
|
|
29
29
|
readonly criticality: {
|
|
@@ -35,4 +35,4 @@ export declare function schemaSubscriptionTypeChangedFromMeta(args: SchemaSubscr
|
|
|
35
35
|
newSubscriptionTypeName: string;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
export declare function schemaSubscriptionTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change<typeof ChangeType.SchemaSubscriptionTypeChanged>;
|
|
38
|
+
export declare function schemaSubscriptionTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaSubscriptionTypeChanged>;
|
|
@@ -11,7 +11,7 @@ export declare function schemaQueryTypeChangedFromMeta(args: SchemaQueryTypeChan
|
|
|
11
11
|
newQueryTypeName: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export declare function schemaQueryTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change<typeof ChangeType.SchemaQueryTypeChanged>;
|
|
14
|
+
export declare function schemaQueryTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaQueryTypeChanged>;
|
|
15
15
|
export declare function schemaMutationTypeChangedFromMeta(args: SchemaMutationTypeChangedChange): {
|
|
16
16
|
readonly type: "SCHEMA_MUTATION_TYPE_CHANGED";
|
|
17
17
|
readonly criticality: {
|
|
@@ -23,7 +23,7 @@ export declare function schemaMutationTypeChangedFromMeta(args: SchemaMutationTy
|
|
|
23
23
|
newMutationTypeName: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
export declare function schemaMutationTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change<typeof ChangeType.SchemaMutationTypeChanged>;
|
|
26
|
+
export declare function schemaMutationTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaMutationTypeChanged>;
|
|
27
27
|
export declare function schemaSubscriptionTypeChangedFromMeta(args: SchemaSubscriptionTypeChangedChange): {
|
|
28
28
|
readonly type: "SCHEMA_SUBSCRIPTION_TYPE_CHANGED";
|
|
29
29
|
readonly criticality: {
|
|
@@ -35,4 +35,4 @@ export declare function schemaSubscriptionTypeChangedFromMeta(args: SchemaSubscr
|
|
|
35
35
|
newSubscriptionTypeName: string;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
export declare function schemaSubscriptionTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change<typeof ChangeType.SchemaSubscriptionTypeChanged>;
|
|
38
|
+
export declare function schemaSubscriptionTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaSubscriptionTypeChanged>;
|
package/typings/diff/index.d.cts
CHANGED
|
@@ -6,4 +6,4 @@ export * from './rules/types.cjs';
|
|
|
6
6
|
export declare const DiffRule: typeof rules;
|
|
7
7
|
export * from './onComplete/types.cjs';
|
|
8
8
|
export type { UsageHandler } from './rules/consider-usage.cjs';
|
|
9
|
-
export declare function diff(oldSchema: GraphQLSchema, newSchema: GraphQLSchema, rules?: Rule[], config?: rules.ConsiderUsageConfig): Promise<Change[]>;
|
|
9
|
+
export declare function diff(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null, rules?: Rule[], config?: rules.ConsiderUsageConfig): Promise<Change[]>;
|
package/typings/diff/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export * from './rules/types.js';
|
|
|
6
6
|
export declare const DiffRule: typeof rules;
|
|
7
7
|
export * from './onComplete/types.js';
|
|
8
8
|
export type { UsageHandler } from './rules/consider-usage.js';
|
|
9
|
-
export declare function diff(oldSchema: GraphQLSchema, newSchema: GraphQLSchema, rules?: Rule[], config?: rules.ConsiderUsageConfig): Promise<Change[]>;
|
|
9
|
+
export declare function diff(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null, rules?: Rule[], config?: rules.ConsiderUsageConfig): Promise<Change[]>;
|
|
@@ -2,7 +2,7 @@ import { GraphQLSchema } from 'graphql';
|
|
|
2
2
|
import { Change } from '../changes/change.cjs';
|
|
3
3
|
export type Rule<TConfig = any> = (input: {
|
|
4
4
|
changes: Change[];
|
|
5
|
-
oldSchema: GraphQLSchema;
|
|
6
|
-
newSchema: GraphQLSchema;
|
|
5
|
+
oldSchema: GraphQLSchema | null;
|
|
6
|
+
newSchema: GraphQLSchema | null;
|
|
7
7
|
config: TConfig;
|
|
8
8
|
}) => Change[] | Promise<Change[]>;
|
|
@@ -2,7 +2,7 @@ import { GraphQLSchema } from 'graphql';
|
|
|
2
2
|
import { Change } from '../changes/change.js';
|
|
3
3
|
export type Rule<TConfig = any> = (input: {
|
|
4
4
|
changes: Change[];
|
|
5
|
-
oldSchema: GraphQLSchema;
|
|
6
|
-
newSchema: GraphQLSchema;
|
|
5
|
+
oldSchema: GraphQLSchema | null;
|
|
6
|
+
newSchema: GraphQLSchema | null;
|
|
7
7
|
config: TConfig;
|
|
8
8
|
}) => Change[] | Promise<Change[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
2
|
import { Change } from './changes/change.cjs';
|
|
3
3
|
export type AddChange = (change: Change) => void;
|
|
4
|
-
export declare function diffSchema(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change[];
|
|
4
|
+
export declare function diffSchema(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change[];
|
package/typings/diff/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
2
|
import { Change } from './changes/change.js';
|
|
3
3
|
export type AddChange = (change: Change) => void;
|
|
4
|
-
export declare function diffSchema(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change[];
|
|
4
|
+
export declare function diffSchema(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change[];
|