@graphql-inspector/core 7.1.0-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 → 7.1.0-alpha-20251210214408-83e88e0012f7cbffde895b877242a59aee57ecc0

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.
@@ -8,13 +8,19 @@ exports.schemaSubscriptionTypeChangedFromMeta = schemaSubscriptionTypeChangedFro
8
8
  exports.schemaSubscriptionTypeChanged = schemaSubscriptionTypeChanged;
9
9
  const change_js_1 = require("./change.js");
10
10
  function buildSchemaQueryTypeChangedMessage(args) {
11
- return `Schema query root has changed from '${args.oldQueryTypeName}' to '${args.newQueryTypeName}'`;
11
+ if (args.oldQueryTypeName === null) {
12
+ return `Schema query root type was set to '${args.newQueryTypeName}'.`;
13
+ }
14
+ if (args.newQueryTypeName === null) {
15
+ return `Schema query root type '${args.oldQueryTypeName}' was removed.`;
16
+ }
17
+ return `Schema query root type was changed from '${args.oldQueryTypeName}' to '${args.newQueryTypeName}'`;
12
18
  }
13
19
  function schemaQueryTypeChangedFromMeta(args) {
14
20
  return {
15
21
  type: change_js_1.ChangeType.SchemaQueryTypeChanged,
16
22
  criticality: {
17
- level: args.meta.oldQueryTypeName === 'unknown'
23
+ level: args.meta.oldQueryTypeName === null
18
24
  ? change_js_1.CriticalityLevel.NonBreaking
19
25
  : change_js_1.CriticalityLevel.Breaking,
20
26
  },
@@ -23,8 +29,8 @@ function schemaQueryTypeChangedFromMeta(args) {
23
29
  };
24
30
  }
25
31
  function schemaQueryTypeChanged(oldSchema, newSchema) {
26
- const oldName = (oldSchema?.getQueryType() || {}).name || 'unknown';
27
- const newName = (newSchema?.getQueryType() || {}).name || 'unknown';
32
+ const oldName = oldSchema?.getQueryType()?.name || null;
33
+ const newName = newSchema?.getQueryType()?.name || null;
28
34
  return schemaQueryTypeChangedFromMeta({
29
35
  type: change_js_1.ChangeType.SchemaQueryTypeChanged,
30
36
  meta: {
@@ -34,13 +40,19 @@ function schemaQueryTypeChanged(oldSchema, newSchema) {
34
40
  });
35
41
  }
36
42
  function buildSchemaMutationTypeChangedMessage(args) {
37
- return `Schema mutation root has changed from '${args.oldMutationTypeName}' to '${args.newMutationTypeName}'`;
43
+ if (args.oldMutationTypeName === null) {
44
+ return `Schema mutation type was set to '${args.newMutationTypeName}'.`;
45
+ }
46
+ if (args.newMutationTypeName === null) {
47
+ return `Schema mutation type '${args.oldMutationTypeName}' was removed.`;
48
+ }
49
+ return `Schema mutation type was changed from '${args.oldMutationTypeName}' to '${args.newMutationTypeName}'`;
38
50
  }
39
51
  function schemaMutationTypeChangedFromMeta(args) {
40
52
  return {
41
53
  type: change_js_1.ChangeType.SchemaMutationTypeChanged,
42
54
  criticality: {
43
- level: args.meta.oldMutationTypeName === 'unknown'
55
+ level: args.meta.oldMutationTypeName === null
44
56
  ? change_js_1.CriticalityLevel.NonBreaking
45
57
  : change_js_1.CriticalityLevel.Breaking,
46
58
  },
@@ -49,8 +61,8 @@ function schemaMutationTypeChangedFromMeta(args) {
49
61
  };
50
62
  }
51
63
  function schemaMutationTypeChanged(oldSchema, newSchema) {
52
- const oldName = (oldSchema?.getMutationType() || {}).name || 'unknown';
53
- const newName = (newSchema?.getMutationType() || {}).name || 'unknown';
64
+ const oldName = oldSchema?.getMutationType()?.name || null;
65
+ const newName = newSchema?.getMutationType()?.name || null;
54
66
  return schemaMutationTypeChangedFromMeta({
55
67
  type: change_js_1.ChangeType.SchemaMutationTypeChanged,
56
68
  meta: {
@@ -60,13 +72,19 @@ function schemaMutationTypeChanged(oldSchema, newSchema) {
60
72
  });
61
73
  }
62
74
  function buildSchemaSubscriptionTypeChangedMessage(args) {
63
- return `Schema subscription root has changed from '${args.oldSubscriptionTypeName}' to '${args.newSubscriptionTypeName}'`;
75
+ if (args.oldSubscriptionTypeName === null) {
76
+ return `Schema subscription type was set to '${args.newSubscriptionTypeName}'.`;
77
+ }
78
+ if (args.newSubscriptionTypeName === null) {
79
+ return `Schema subscription type '${args.oldSubscriptionTypeName}' was removed.`;
80
+ }
81
+ return `Schema subscription type was changed from '${args.oldSubscriptionTypeName}' to '${args.newSubscriptionTypeName}'`;
64
82
  }
65
83
  function schemaSubscriptionTypeChangedFromMeta(args) {
66
84
  return {
67
85
  type: change_js_1.ChangeType.SchemaSubscriptionTypeChanged,
68
86
  criticality: {
69
- level: args.meta.oldSubscriptionTypeName === 'unknown'
87
+ level: args.meta.oldSubscriptionTypeName === null
70
88
  ? change_js_1.CriticalityLevel.NonBreaking
71
89
  : change_js_1.CriticalityLevel.Breaking,
72
90
  },
@@ -75,8 +93,8 @@ function schemaSubscriptionTypeChangedFromMeta(args) {
75
93
  };
76
94
  }
77
95
  function schemaSubscriptionTypeChanged(oldSchema, newSchema) {
78
- const oldName = (oldSchema?.getSubscriptionType() || {}).name || 'unknown';
79
- const newName = (newSchema?.getSubscriptionType() || {}).name || 'unknown';
96
+ const oldName = oldSchema?.getSubscriptionType()?.name || null;
97
+ const newName = newSchema?.getSubscriptionType()?.name || null;
80
98
  return schemaSubscriptionTypeChangedFromMeta({
81
99
  type: change_js_1.ChangeType.SchemaSubscriptionTypeChanged,
82
100
  meta: {
@@ -1,12 +1,18 @@
1
1
  import { ChangeType, CriticalityLevel, } from './change.js';
2
2
  function buildSchemaQueryTypeChangedMessage(args) {
3
- return `Schema query root has changed from '${args.oldQueryTypeName}' to '${args.newQueryTypeName}'`;
3
+ if (args.oldQueryTypeName === null) {
4
+ return `Schema query root type was set to '${args.newQueryTypeName}'.`;
5
+ }
6
+ if (args.newQueryTypeName === null) {
7
+ return `Schema query root type '${args.oldQueryTypeName}' was removed.`;
8
+ }
9
+ return `Schema query root type was changed from '${args.oldQueryTypeName}' to '${args.newQueryTypeName}'`;
4
10
  }
5
11
  export function schemaQueryTypeChangedFromMeta(args) {
6
12
  return {
7
13
  type: ChangeType.SchemaQueryTypeChanged,
8
14
  criticality: {
9
- level: args.meta.oldQueryTypeName === 'unknown'
15
+ level: args.meta.oldQueryTypeName === null
10
16
  ? CriticalityLevel.NonBreaking
11
17
  : CriticalityLevel.Breaking,
12
18
  },
@@ -15,8 +21,8 @@ export function schemaQueryTypeChangedFromMeta(args) {
15
21
  };
16
22
  }
17
23
  export function schemaQueryTypeChanged(oldSchema, newSchema) {
18
- const oldName = (oldSchema?.getQueryType() || {}).name || 'unknown';
19
- const newName = (newSchema?.getQueryType() || {}).name || 'unknown';
24
+ const oldName = oldSchema?.getQueryType()?.name || null;
25
+ const newName = newSchema?.getQueryType()?.name || null;
20
26
  return schemaQueryTypeChangedFromMeta({
21
27
  type: ChangeType.SchemaQueryTypeChanged,
22
28
  meta: {
@@ -26,13 +32,19 @@ export function schemaQueryTypeChanged(oldSchema, newSchema) {
26
32
  });
27
33
  }
28
34
  function buildSchemaMutationTypeChangedMessage(args) {
29
- return `Schema mutation root has changed from '${args.oldMutationTypeName}' to '${args.newMutationTypeName}'`;
35
+ if (args.oldMutationTypeName === null) {
36
+ return `Schema mutation type was set to '${args.newMutationTypeName}'.`;
37
+ }
38
+ if (args.newMutationTypeName === null) {
39
+ return `Schema mutation type '${args.oldMutationTypeName}' was removed.`;
40
+ }
41
+ return `Schema mutation type was changed from '${args.oldMutationTypeName}' to '${args.newMutationTypeName}'`;
30
42
  }
31
43
  export function schemaMutationTypeChangedFromMeta(args) {
32
44
  return {
33
45
  type: ChangeType.SchemaMutationTypeChanged,
34
46
  criticality: {
35
- level: args.meta.oldMutationTypeName === 'unknown'
47
+ level: args.meta.oldMutationTypeName === null
36
48
  ? CriticalityLevel.NonBreaking
37
49
  : CriticalityLevel.Breaking,
38
50
  },
@@ -41,8 +53,8 @@ export function schemaMutationTypeChangedFromMeta(args) {
41
53
  };
42
54
  }
43
55
  export function schemaMutationTypeChanged(oldSchema, newSchema) {
44
- const oldName = (oldSchema?.getMutationType() || {}).name || 'unknown';
45
- const newName = (newSchema?.getMutationType() || {}).name || 'unknown';
56
+ const oldName = oldSchema?.getMutationType()?.name || null;
57
+ const newName = newSchema?.getMutationType()?.name || null;
46
58
  return schemaMutationTypeChangedFromMeta({
47
59
  type: ChangeType.SchemaMutationTypeChanged,
48
60
  meta: {
@@ -52,13 +64,19 @@ export function schemaMutationTypeChanged(oldSchema, newSchema) {
52
64
  });
53
65
  }
54
66
  function buildSchemaSubscriptionTypeChangedMessage(args) {
55
- return `Schema subscription root has changed from '${args.oldSubscriptionTypeName}' to '${args.newSubscriptionTypeName}'`;
67
+ if (args.oldSubscriptionTypeName === null) {
68
+ return `Schema subscription type was set to '${args.newSubscriptionTypeName}'.`;
69
+ }
70
+ if (args.newSubscriptionTypeName === null) {
71
+ return `Schema subscription type '${args.oldSubscriptionTypeName}' was removed.`;
72
+ }
73
+ return `Schema subscription type was changed from '${args.oldSubscriptionTypeName}' to '${args.newSubscriptionTypeName}'`;
56
74
  }
57
75
  export function schemaSubscriptionTypeChangedFromMeta(args) {
58
76
  return {
59
77
  type: ChangeType.SchemaSubscriptionTypeChanged,
60
78
  criticality: {
61
- level: args.meta.oldSubscriptionTypeName === 'unknown'
79
+ level: args.meta.oldSubscriptionTypeName === null
62
80
  ? CriticalityLevel.NonBreaking
63
81
  : CriticalityLevel.Breaking,
64
82
  },
@@ -67,8 +85,8 @@ export function schemaSubscriptionTypeChangedFromMeta(args) {
67
85
  };
68
86
  }
69
87
  export function schemaSubscriptionTypeChanged(oldSchema, newSchema) {
70
- const oldName = (oldSchema?.getSubscriptionType() || {}).name || 'unknown';
71
- const newName = (newSchema?.getSubscriptionType() || {}).name || 'unknown';
88
+ const oldName = oldSchema?.getSubscriptionType()?.name || null;
89
+ const newName = newSchema?.getSubscriptionType()?.name || null;
72
90
  return schemaSubscriptionTypeChangedFromMeta({
73
91
  type: ChangeType.SchemaSubscriptionTypeChanged,
74
92
  meta: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-inspector/core",
3
- "version": "7.1.0-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425",
3
+ "version": "7.1.0-alpha-20251210214408-83e88e0012f7cbffde895b877242a59aee57ecc0",
4
4
  "description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -491,22 +491,22 @@ export type ObjectTypeInterfaceRemovedChange = {
491
491
  export type SchemaQueryTypeChangedChange = {
492
492
  type: typeof ChangeType.SchemaQueryTypeChanged;
493
493
  meta: {
494
- oldQueryTypeName: string;
495
- newQueryTypeName: string;
494
+ oldQueryTypeName: string | null;
495
+ newQueryTypeName: string | null;
496
496
  };
497
497
  };
498
498
  export type SchemaMutationTypeChangedChange = {
499
499
  type: typeof ChangeType.SchemaMutationTypeChanged;
500
500
  meta: {
501
- oldMutationTypeName: string;
502
- newMutationTypeName: string;
501
+ oldMutationTypeName: string | null;
502
+ newMutationTypeName: string | null;
503
503
  };
504
504
  };
505
505
  export type SchemaSubscriptionTypeChangedChange = {
506
506
  type: typeof ChangeType.SchemaSubscriptionTypeChanged;
507
507
  meta: {
508
- oldSubscriptionTypeName: string;
509
- newSubscriptionTypeName: string;
508
+ oldSubscriptionTypeName: string | null;
509
+ newSubscriptionTypeName: string | null;
510
510
  };
511
511
  };
512
512
  export type TypeRemovedChange = {
@@ -491,22 +491,22 @@ export type ObjectTypeInterfaceRemovedChange = {
491
491
  export type SchemaQueryTypeChangedChange = {
492
492
  type: typeof ChangeType.SchemaQueryTypeChanged;
493
493
  meta: {
494
- oldQueryTypeName: string;
495
- newQueryTypeName: string;
494
+ oldQueryTypeName: string | null;
495
+ newQueryTypeName: string | null;
496
496
  };
497
497
  };
498
498
  export type SchemaMutationTypeChangedChange = {
499
499
  type: typeof ChangeType.SchemaMutationTypeChanged;
500
500
  meta: {
501
- oldMutationTypeName: string;
502
- newMutationTypeName: string;
501
+ oldMutationTypeName: string | null;
502
+ newMutationTypeName: string | null;
503
503
  };
504
504
  };
505
505
  export type SchemaSubscriptionTypeChangedChange = {
506
506
  type: typeof ChangeType.SchemaSubscriptionTypeChanged;
507
507
  meta: {
508
- oldSubscriptionTypeName: string;
509
- newSubscriptionTypeName: string;
508
+ oldSubscriptionTypeName: string | null;
509
+ newSubscriptionTypeName: string | null;
510
510
  };
511
511
  };
512
512
  export type TypeRemovedChange = {
@@ -7,8 +7,8 @@ export declare function schemaQueryTypeChangedFromMeta(args: SchemaQueryTypeChan
7
7
  };
8
8
  readonly message: string;
9
9
  readonly meta: {
10
- oldQueryTypeName: string;
11
- newQueryTypeName: string;
10
+ oldQueryTypeName: string | null;
11
+ newQueryTypeName: string | null;
12
12
  };
13
13
  };
14
14
  export declare function schemaQueryTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaQueryTypeChanged>;
@@ -19,8 +19,8 @@ export declare function schemaMutationTypeChangedFromMeta(args: SchemaMutationTy
19
19
  };
20
20
  readonly message: string;
21
21
  readonly meta: {
22
- oldMutationTypeName: string;
23
- newMutationTypeName: string;
22
+ oldMutationTypeName: string | null;
23
+ newMutationTypeName: string | null;
24
24
  };
25
25
  };
26
26
  export declare function schemaMutationTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaMutationTypeChanged>;
@@ -31,8 +31,8 @@ export declare function schemaSubscriptionTypeChangedFromMeta(args: SchemaSubscr
31
31
  };
32
32
  readonly message: string;
33
33
  readonly meta: {
34
- oldSubscriptionTypeName: string;
35
- newSubscriptionTypeName: string;
34
+ oldSubscriptionTypeName: string | null;
35
+ newSubscriptionTypeName: string | null;
36
36
  };
37
37
  };
38
38
  export declare function schemaSubscriptionTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaSubscriptionTypeChanged>;
@@ -7,8 +7,8 @@ export declare function schemaQueryTypeChangedFromMeta(args: SchemaQueryTypeChan
7
7
  };
8
8
  readonly message: string;
9
9
  readonly meta: {
10
- oldQueryTypeName: string;
11
- newQueryTypeName: string;
10
+ oldQueryTypeName: string | null;
11
+ newQueryTypeName: string | null;
12
12
  };
13
13
  };
14
14
  export declare function schemaQueryTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaQueryTypeChanged>;
@@ -19,8 +19,8 @@ export declare function schemaMutationTypeChangedFromMeta(args: SchemaMutationTy
19
19
  };
20
20
  readonly message: string;
21
21
  readonly meta: {
22
- oldMutationTypeName: string;
23
- newMutationTypeName: string;
22
+ oldMutationTypeName: string | null;
23
+ newMutationTypeName: string | null;
24
24
  };
25
25
  };
26
26
  export declare function schemaMutationTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaMutationTypeChanged>;
@@ -31,8 +31,8 @@ export declare function schemaSubscriptionTypeChangedFromMeta(args: SchemaSubscr
31
31
  };
32
32
  readonly message: string;
33
33
  readonly meta: {
34
- oldSubscriptionTypeName: string;
35
- newSubscriptionTypeName: string;
34
+ oldSubscriptionTypeName: string | null;
35
+ newSubscriptionTypeName: string | null;
36
36
  };
37
37
  };
38
38
  export declare function schemaSubscriptionTypeChanged(oldSchema: GraphQLSchema | null, newSchema: GraphQLSchema | null): Change<typeof ChangeType.SchemaSubscriptionTypeChanged>;