@graphql-inspector/core 7.0.3 → 7.0.4-alpha-20251209220655-34aadc8b6d7b9eb674f5ab85c5fbad474e045e30
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 +7 -1
- package/cjs/diff/changes/directive.js +14 -2
- package/cjs/diff/changes/enum.js +7 -5
- package/cjs/diff/changes/field.js +15 -4
- package/cjs/diff/changes/input.js +7 -3
- package/cjs/diff/changes/type.js +8 -3
- package/esm/diff/changes/argument.js +8 -2
- package/esm/diff/changes/directive.js +15 -3
- package/esm/diff/changes/enum.js +7 -5
- package/esm/diff/changes/field.js +15 -4
- package/esm/diff/changes/input.js +8 -4
- package/esm/diff/changes/type.js +8 -3
- package/package.json +1 -1
|
@@ -10,7 +10,13 @@ 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
|
-
|
|
13
|
+
if (args.oldDescription === null && args.newDescription !== null) {
|
|
14
|
+
return `Description '${(0, string_js_1.fmt)(args.newDescription)}' was added to argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}'`;
|
|
15
|
+
}
|
|
16
|
+
if (args.newDescription === null && args.oldDescription !== null) {
|
|
17
|
+
return `Description '${(0, string_js_1.fmt)(args.oldDescription)}' was removed from argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}'`;
|
|
18
|
+
}
|
|
19
|
+
return `Description for argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}' changed from '${(0, string_js_1.fmt)(args.oldDescription ?? '')}' to '${(0, string_js_1.fmt)(args.newDescription ?? '')}'`;
|
|
14
20
|
}
|
|
15
21
|
function fieldArgumentDescriptionChangedFromMeta(args) {
|
|
16
22
|
return {
|
|
@@ -78,7 +78,13 @@ function directiveAdded(directive) {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
function buildDirectiveDescriptionChangedMessage(args) {
|
|
81
|
-
|
|
81
|
+
if (args.oldDirectiveDescription === null && args.newDirectiveDescription !== null) {
|
|
82
|
+
return `Directive '${args.directiveName}' description '${(0, string_js_1.fmt)(args.newDirectiveDescription)}' was added`;
|
|
83
|
+
}
|
|
84
|
+
if (args.newDirectiveDescription === null && args.oldDirectiveDescription !== null) {
|
|
85
|
+
return `Directive '${args.directiveName}' description '${(0, string_js_1.fmt)(args.oldDirectiveDescription)}' was removed`;
|
|
86
|
+
}
|
|
87
|
+
return `Directive '${args.directiveName}' description changed from '${(0, string_js_1.fmt)(args.oldDirectiveDescription ?? '')}' to '${(0, string_js_1.fmt)(args.newDirectiveDescription ?? '')}'`;
|
|
82
88
|
}
|
|
83
89
|
function directiveDescriptionChangedFromMeta(args) {
|
|
84
90
|
return {
|
|
@@ -258,7 +264,13 @@ function directiveArgumentRemoved(directive, arg) {
|
|
|
258
264
|
});
|
|
259
265
|
}
|
|
260
266
|
function buildDirectiveArgumentDescriptionChangedMessage(args) {
|
|
261
|
-
|
|
267
|
+
if (args.oldDirectiveArgumentDescription === null && args.newDirectiveArgumentDescription !== null) {
|
|
268
|
+
return `Description '${(0, string_js_1.fmt)(args.newDirectiveArgumentDescription)}' was added to argument '${args.directiveArgumentName}' on directive '${args.directiveName}'`;
|
|
269
|
+
}
|
|
270
|
+
if (args.newDirectiveArgumentDescription === null && args.oldDirectiveArgumentDescription !== null) {
|
|
271
|
+
return `Description '${(0, string_js_1.fmt)(args.oldDirectiveArgumentDescription)}' was removed from argument '${args.directiveArgumentName}' on directive '${args.directiveName}'`;
|
|
272
|
+
}
|
|
273
|
+
return `Description for argument '${args.directiveArgumentName}' on directive '${args.directiveName}' changed from '${(0, string_js_1.fmt)(args.oldDirectiveArgumentDescription ?? '')}' to '${(0, string_js_1.fmt)(args.newDirectiveArgumentDescription ?? '')}'`;
|
|
262
274
|
}
|
|
263
275
|
function directiveArgumentDescriptionChangedFromMeta(args) {
|
|
264
276
|
return {
|
package/cjs/diff/changes/enum.js
CHANGED
|
@@ -72,11 +72,13 @@ function enumValueAdded(type, value, addedToNewType) {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
function buildEnumValueDescriptionChangedMessage(args) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
if (args.oldEnumValueDescription === null && args.newEnumValueDescription !== null) {
|
|
76
|
+
return `Description '${(0, string_js_1.fmt)(args.newEnumValueDescription)}' was added to enum value '${args.enumName}.${args.enumValueName}'`;
|
|
77
|
+
}
|
|
78
|
+
if (args.newEnumValueDescription === null && args.oldEnumValueDescription !== null) {
|
|
79
|
+
return `Description '${(0, string_js_1.fmt)(args.oldEnumValueDescription)}' was removed from enum value '${args.enumName}.${args.enumValueName}'`;
|
|
80
|
+
}
|
|
81
|
+
return `Description for enum value '${args.enumName}.${args.enumValueName}' changed from '${(0, string_js_1.fmt)(args.oldEnumValueDescription ?? '')}' to '${(0, string_js_1.fmt)(args.newEnumValueDescription ?? '')}'`;
|
|
80
82
|
}
|
|
81
83
|
function enumValueDescriptionChangedFromMeta(args) {
|
|
82
84
|
return {
|
|
@@ -28,6 +28,7 @@ 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");
|
|
31
32
|
const change_js_1 = require("./change.js");
|
|
32
33
|
function buildFieldRemovedMessage(args) {
|
|
33
34
|
return `Field '${args.removedFieldName}' ${args.isRemovedFieldDeprecated ? '(deprecated) ' : ''}was removed from ${args.typeType} '${args.typeName}'`;
|
|
@@ -85,7 +86,13 @@ function fieldAdded(type, field) {
|
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
function buildFieldDescriptionChangedMessage(args) {
|
|
88
|
-
|
|
89
|
+
if (!args.oldDescription && args.newDescription) {
|
|
90
|
+
return `Field '${args.typeName}.${args.fieldName}' description '${(0, string_js_1.fmt)(args.newDescription)}' was added`;
|
|
91
|
+
}
|
|
92
|
+
if (!args.newDescription && args.oldDescription) {
|
|
93
|
+
return `Field '${args.typeName}.${args.fieldName}' description '${(0, string_js_1.fmt)(args.oldDescription)}' was removed`;
|
|
94
|
+
}
|
|
95
|
+
return `Field '${args.typeName}.${args.fieldName}' description changed from '${(0, string_js_1.fmt)(args.oldDescription)}' to '${(0, string_js_1.fmt)(args.newDescription)}'`;
|
|
89
96
|
}
|
|
90
97
|
function fieldDescriptionChangedFromMeta(args) {
|
|
91
98
|
return {
|
|
@@ -110,7 +117,8 @@ function fieldDescriptionChanged(type, oldField, newField) {
|
|
|
110
117
|
});
|
|
111
118
|
}
|
|
112
119
|
function buildFieldDescriptionAddedMessage(args) {
|
|
113
|
-
|
|
120
|
+
const desc = (0, string_js_1.fmt)(args.addedDescription);
|
|
121
|
+
return `Field '${args.typeName}.${args.fieldName}' has description '${desc}'`;
|
|
114
122
|
}
|
|
115
123
|
function fieldDescriptionAddedFromMeta(args) {
|
|
116
124
|
return {
|
|
@@ -201,7 +209,9 @@ function fieldDeprecationRemoved(type, field) {
|
|
|
201
209
|
});
|
|
202
210
|
}
|
|
203
211
|
function buildFieldDeprecationReasonChangedMessage(args) {
|
|
204
|
-
|
|
212
|
+
const oldReason = (0, string_js_1.fmt)(args.oldDeprecationReason);
|
|
213
|
+
const newReason = (0, string_js_1.fmt)(args.newDeprecationReason);
|
|
214
|
+
return `Deprecation reason on field '${args.typeName}.${args.fieldName}' has changed from '${oldReason}' to '${newReason}'`;
|
|
205
215
|
}
|
|
206
216
|
function fieldDeprecationReasonChangedFromMeta(args) {
|
|
207
217
|
return {
|
|
@@ -226,7 +236,8 @@ function fieldDeprecationReasonChanged(type, oldField, newField) {
|
|
|
226
236
|
});
|
|
227
237
|
}
|
|
228
238
|
function buildFieldDeprecationReasonAddedMessage(args) {
|
|
229
|
-
|
|
239
|
+
const reason = (0, string_js_1.fmt)(args.addedDeprecationReason);
|
|
240
|
+
return `Field '${args.typeName}.${args.fieldName}' has deprecation reason '${reason}'`;
|
|
230
241
|
}
|
|
231
242
|
function fieldDeprecationReasonAddedFromMeta(args) {
|
|
232
243
|
return {
|
|
@@ -82,7 +82,8 @@ function inputFieldAdded(input, field, addedToNewType) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function buildInputFieldDescriptionAddedMessage(args) {
|
|
85
|
-
|
|
85
|
+
const desc = (0, string_js_1.fmt)(args.addedInputFieldDescription);
|
|
86
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' has description '${desc}'`;
|
|
86
87
|
}
|
|
87
88
|
function inputFieldDescriptionAddedFromMeta(args) {
|
|
88
89
|
return {
|
|
@@ -106,7 +107,8 @@ function inputFieldDescriptionAdded(type, field) {
|
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
109
|
function buildInputFieldDescriptionRemovedMessage(args) {
|
|
109
|
-
|
|
110
|
+
const desc = (0, string_js_1.fmt)(args.removedDescription);
|
|
111
|
+
return `Description '${desc}' was removed from input field '${args.inputName}.${args.inputFieldName}'`;
|
|
110
112
|
}
|
|
111
113
|
function inputFieldDescriptionRemovedFromMeta(args) {
|
|
112
114
|
return {
|
|
@@ -130,7 +132,9 @@ function inputFieldDescriptionRemoved(type, field) {
|
|
|
130
132
|
});
|
|
131
133
|
}
|
|
132
134
|
function buildInputFieldDescriptionChangedMessage(args) {
|
|
133
|
-
|
|
135
|
+
const oldDesc = (0, string_js_1.fmt)(args.oldInputFieldDescription);
|
|
136
|
+
const newDesc = (0, string_js_1.fmt)(args.newInputFieldDescription);
|
|
137
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
134
138
|
}
|
|
135
139
|
function inputFieldDescriptionChangedFromMeta(args) {
|
|
136
140
|
return {
|
package/cjs/diff/changes/type.js
CHANGED
|
@@ -14,6 +14,7 @@ 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");
|
|
17
18
|
const change_js_1 = require("./change.js");
|
|
18
19
|
function buildTypeRemovedMessage(type) {
|
|
19
20
|
return `Type '${type.removedTypeName}' was removed`;
|
|
@@ -114,7 +115,9 @@ function typeKindChanged(oldType, newType) {
|
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
117
|
function buildTypeDescriptionChangedMessage(args) {
|
|
117
|
-
|
|
118
|
+
const oldDesc = (0, string_js_1.fmt)(args.oldTypeDescription);
|
|
119
|
+
const newDesc = (0, string_js_1.fmt)(args.newTypeDescription);
|
|
120
|
+
return `Description '${oldDesc}' on type '${args.typeName}' has changed to '${newDesc}'`;
|
|
118
121
|
}
|
|
119
122
|
function typeDescriptionChangedFromMeta(args) {
|
|
120
123
|
return {
|
|
@@ -138,7 +141,8 @@ function typeDescriptionChanged(oldType, newType) {
|
|
|
138
141
|
});
|
|
139
142
|
}
|
|
140
143
|
function buildTypeDescriptionRemoved(args) {
|
|
141
|
-
|
|
144
|
+
const desc = (0, string_js_1.fmt)(args.removedTypeDescription);
|
|
145
|
+
return `Description '${desc}' was removed from object type '${args.typeName}'`;
|
|
142
146
|
}
|
|
143
147
|
function typeDescriptionRemovedFromMeta(args) {
|
|
144
148
|
return {
|
|
@@ -161,7 +165,8 @@ function typeDescriptionRemoved(type) {
|
|
|
161
165
|
});
|
|
162
166
|
}
|
|
163
167
|
function buildTypeDescriptionAddedMessage(args) {
|
|
164
|
-
|
|
168
|
+
const desc = (0, string_js_1.fmt)(args.addedTypeDescription);
|
|
169
|
+
return `Object type '${args.typeName}' has description '${desc}'`;
|
|
165
170
|
}
|
|
166
171
|
function typeDescriptionAddedFromMeta(args) {
|
|
167
172
|
return {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { safeChangeForInputValue } from '../../utils/graphql.js';
|
|
2
|
-
import { safeString } from '../../utils/string.js';
|
|
2
|
+
import { fmt, safeString } from '../../utils/string.js';
|
|
3
3
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
4
4
|
function buildFieldArgumentDescriptionChangedMessage(args) {
|
|
5
|
-
|
|
5
|
+
if (args.oldDescription === null && args.newDescription !== null) {
|
|
6
|
+
return `Description '${fmt(args.newDescription)}' was added to argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}'`;
|
|
7
|
+
}
|
|
8
|
+
if (args.newDescription === null && args.oldDescription !== null) {
|
|
9
|
+
return `Description '${fmt(args.oldDescription)}' was removed from argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}'`;
|
|
10
|
+
}
|
|
11
|
+
return `Description for argument '${args.argumentName}' on field '${args.typeName}.${args.fieldName}' changed from '${fmt(args.oldDescription ?? '')}' to '${fmt(args.newDescription ?? '')}'`;
|
|
6
12
|
}
|
|
7
13
|
export function fieldArgumentDescriptionChangedFromMeta(args) {
|
|
8
14
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNonNullType } from 'graphql';
|
|
2
2
|
import { safeChangeForInputValue } from '../../utils/graphql.js';
|
|
3
|
-
import { safeString } from '../../utils/string.js';
|
|
3
|
+
import { fmt, 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,7 +52,13 @@ export function directiveAdded(directive) {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function buildDirectiveDescriptionChangedMessage(args) {
|
|
55
|
-
|
|
55
|
+
if (args.oldDirectiveDescription === null && args.newDirectiveDescription !== null) {
|
|
56
|
+
return `Directive '${args.directiveName}' description '${fmt(args.newDirectiveDescription)}' was added`;
|
|
57
|
+
}
|
|
58
|
+
if (args.newDirectiveDescription === null && args.oldDirectiveDescription !== null) {
|
|
59
|
+
return `Directive '${args.directiveName}' description '${fmt(args.oldDirectiveDescription)}' was removed`;
|
|
60
|
+
}
|
|
61
|
+
return `Directive '${args.directiveName}' description changed from '${fmt(args.oldDirectiveDescription ?? '')}' to '${fmt(args.newDirectiveDescription ?? '')}'`;
|
|
56
62
|
}
|
|
57
63
|
export function directiveDescriptionChangedFromMeta(args) {
|
|
58
64
|
return {
|
|
@@ -232,7 +238,13 @@ export function directiveArgumentRemoved(directive, arg) {
|
|
|
232
238
|
});
|
|
233
239
|
}
|
|
234
240
|
function buildDirectiveArgumentDescriptionChangedMessage(args) {
|
|
235
|
-
|
|
241
|
+
if (args.oldDirectiveArgumentDescription === null && args.newDirectiveArgumentDescription !== null) {
|
|
242
|
+
return `Description '${fmt(args.newDirectiveArgumentDescription)}' was added to argument '${args.directiveArgumentName}' on directive '${args.directiveName}'`;
|
|
243
|
+
}
|
|
244
|
+
if (args.newDirectiveArgumentDescription === null && args.oldDirectiveArgumentDescription !== null) {
|
|
245
|
+
return `Description '${fmt(args.oldDirectiveArgumentDescription)}' was removed from argument '${args.directiveArgumentName}' on directive '${args.directiveName}'`;
|
|
246
|
+
}
|
|
247
|
+
return `Description for argument '${args.directiveArgumentName}' on directive '${args.directiveName}' changed from '${fmt(args.oldDirectiveArgumentDescription ?? '')}' to '${fmt(args.newDirectiveArgumentDescription ?? '')}'`;
|
|
236
248
|
}
|
|
237
249
|
export function directiveArgumentDescriptionChangedFromMeta(args) {
|
|
238
250
|
return {
|
package/esm/diff/changes/enum.js
CHANGED
|
@@ -58,11 +58,13 @@ export function enumValueAdded(type, value, addedToNewType) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
function buildEnumValueDescriptionChangedMessage(args) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
if (args.oldEnumValueDescription === null && args.newEnumValueDescription !== null) {
|
|
62
|
+
return `Description '${fmt(args.newEnumValueDescription)}' was added to enum value '${args.enumName}.${args.enumValueName}'`;
|
|
63
|
+
}
|
|
64
|
+
if (args.newEnumValueDescription === null && args.oldEnumValueDescription !== null) {
|
|
65
|
+
return `Description '${fmt(args.oldEnumValueDescription)}' was removed from enum value '${args.enumName}.${args.enumValueName}'`;
|
|
66
|
+
}
|
|
67
|
+
return `Description for enum value '${args.enumName}.${args.enumValueName}' changed from '${fmt(args.oldEnumValueDescription ?? '')}' to '${fmt(args.newEnumValueDescription ?? '')}'`;
|
|
66
68
|
}
|
|
67
69
|
export function enumValueDescriptionChangedFromMeta(args) {
|
|
68
70
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GraphQLDeprecatedDirective, isInterfaceType, isNonNullType, } from 'graphql';
|
|
2
2
|
import { safeChangeForField } from '../../utils/graphql.js';
|
|
3
|
+
import { fmt } from '../../utils/string.js';
|
|
3
4
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
4
5
|
function buildFieldRemovedMessage(args) {
|
|
5
6
|
return `Field '${args.removedFieldName}' ${args.isRemovedFieldDeprecated ? '(deprecated) ' : ''}was removed from ${args.typeType} '${args.typeName}'`;
|
|
@@ -57,7 +58,13 @@ export function fieldAdded(type, field) {
|
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
function buildFieldDescriptionChangedMessage(args) {
|
|
60
|
-
|
|
61
|
+
if (!args.oldDescription && args.newDescription) {
|
|
62
|
+
return `Field '${args.typeName}.${args.fieldName}' description '${fmt(args.newDescription)}' was added`;
|
|
63
|
+
}
|
|
64
|
+
if (!args.newDescription && args.oldDescription) {
|
|
65
|
+
return `Field '${args.typeName}.${args.fieldName}' description '${fmt(args.oldDescription)}' was removed`;
|
|
66
|
+
}
|
|
67
|
+
return `Field '${args.typeName}.${args.fieldName}' description changed from '${fmt(args.oldDescription)}' to '${fmt(args.newDescription)}'`;
|
|
61
68
|
}
|
|
62
69
|
export function fieldDescriptionChangedFromMeta(args) {
|
|
63
70
|
return {
|
|
@@ -82,7 +89,8 @@ export function fieldDescriptionChanged(type, oldField, newField) {
|
|
|
82
89
|
});
|
|
83
90
|
}
|
|
84
91
|
function buildFieldDescriptionAddedMessage(args) {
|
|
85
|
-
|
|
92
|
+
const desc = fmt(args.addedDescription);
|
|
93
|
+
return `Field '${args.typeName}.${args.fieldName}' has description '${desc}'`;
|
|
86
94
|
}
|
|
87
95
|
export function fieldDescriptionAddedFromMeta(args) {
|
|
88
96
|
return {
|
|
@@ -173,7 +181,9 @@ export function fieldDeprecationRemoved(type, field) {
|
|
|
173
181
|
});
|
|
174
182
|
}
|
|
175
183
|
function buildFieldDeprecationReasonChangedMessage(args) {
|
|
176
|
-
|
|
184
|
+
const oldReason = fmt(args.oldDeprecationReason);
|
|
185
|
+
const newReason = fmt(args.newDeprecationReason);
|
|
186
|
+
return `Deprecation reason on field '${args.typeName}.${args.fieldName}' has changed from '${oldReason}' to '${newReason}'`;
|
|
177
187
|
}
|
|
178
188
|
export function fieldDeprecationReasonChangedFromMeta(args) {
|
|
179
189
|
return {
|
|
@@ -198,7 +208,8 @@ export function fieldDeprecationReasonChanged(type, oldField, newField) {
|
|
|
198
208
|
});
|
|
199
209
|
}
|
|
200
210
|
function buildFieldDeprecationReasonAddedMessage(args) {
|
|
201
|
-
|
|
211
|
+
const reason = fmt(args.addedDeprecationReason);
|
|
212
|
+
return `Field '${args.typeName}.${args.fieldName}' has deprecation reason '${reason}'`;
|
|
202
213
|
}
|
|
203
214
|
export function fieldDeprecationReasonAddedFromMeta(args) {
|
|
204
215
|
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 { safeString } from '../../utils/string.js';
|
|
4
|
+
import { fmt, 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,7 +65,8 @@ export function inputFieldAdded(input, field, addedToNewType) {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function buildInputFieldDescriptionAddedMessage(args) {
|
|
68
|
-
|
|
68
|
+
const desc = fmt(args.addedInputFieldDescription);
|
|
69
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' has description '${desc}'`;
|
|
69
70
|
}
|
|
70
71
|
export function inputFieldDescriptionAddedFromMeta(args) {
|
|
71
72
|
return {
|
|
@@ -89,7 +90,8 @@ export function inputFieldDescriptionAdded(type, field) {
|
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
function buildInputFieldDescriptionRemovedMessage(args) {
|
|
92
|
-
|
|
93
|
+
const desc = fmt(args.removedDescription);
|
|
94
|
+
return `Description '${desc}' was removed from input field '${args.inputName}.${args.inputFieldName}'`;
|
|
93
95
|
}
|
|
94
96
|
export function inputFieldDescriptionRemovedFromMeta(args) {
|
|
95
97
|
return {
|
|
@@ -113,7 +115,9 @@ export function inputFieldDescriptionRemoved(type, field) {
|
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
117
|
function buildInputFieldDescriptionChangedMessage(args) {
|
|
116
|
-
|
|
118
|
+
const oldDesc = fmt(args.oldInputFieldDescription);
|
|
119
|
+
const newDesc = fmt(args.newInputFieldDescription);
|
|
120
|
+
return `Input field '${args.inputName}.${args.inputFieldName}' description changed from '${oldDesc}' to '${newDesc}'`;
|
|
117
121
|
}
|
|
118
122
|
export function inputFieldDescriptionChangedFromMeta(args) {
|
|
119
123
|
return {
|
package/esm/diff/changes/type.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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';
|
|
3
4
|
import { ChangeType, CriticalityLevel, } from './change.js';
|
|
4
5
|
function buildTypeRemovedMessage(type) {
|
|
5
6
|
return `Type '${type.removedTypeName}' was removed`;
|
|
@@ -100,7 +101,9 @@ export function typeKindChanged(oldType, newType) {
|
|
|
100
101
|
});
|
|
101
102
|
}
|
|
102
103
|
function buildTypeDescriptionChangedMessage(args) {
|
|
103
|
-
|
|
104
|
+
const oldDesc = fmt(args.oldTypeDescription);
|
|
105
|
+
const newDesc = fmt(args.newTypeDescription);
|
|
106
|
+
return `Description '${oldDesc}' on type '${args.typeName}' has changed to '${newDesc}'`;
|
|
104
107
|
}
|
|
105
108
|
export function typeDescriptionChangedFromMeta(args) {
|
|
106
109
|
return {
|
|
@@ -124,7 +127,8 @@ export function typeDescriptionChanged(oldType, newType) {
|
|
|
124
127
|
});
|
|
125
128
|
}
|
|
126
129
|
function buildTypeDescriptionRemoved(args) {
|
|
127
|
-
|
|
130
|
+
const desc = fmt(args.removedTypeDescription);
|
|
131
|
+
return `Description '${desc}' was removed from object type '${args.typeName}'`;
|
|
128
132
|
}
|
|
129
133
|
export function typeDescriptionRemovedFromMeta(args) {
|
|
130
134
|
return {
|
|
@@ -147,7 +151,8 @@ export function typeDescriptionRemoved(type) {
|
|
|
147
151
|
});
|
|
148
152
|
}
|
|
149
153
|
function buildTypeDescriptionAddedMessage(args) {
|
|
150
|
-
|
|
154
|
+
const desc = fmt(args.addedTypeDescription);
|
|
155
|
+
return `Object type '${args.typeName}' has description '${desc}'`;
|
|
151
156
|
}
|
|
152
157
|
export function typeDescriptionAddedFromMeta(args) {
|
|
153
158
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-inspector/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.4-alpha-20251209220655-34aadc8b6d7b9eb674f5ab85c5fbad474e045e30",
|
|
4
4
|
"description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|