@graphql-inspector/core 3.1.1 → 3.1.2

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/README.md CHANGED
@@ -36,17 +36,17 @@ import {
36
36
  Change,
37
37
  InvalidDocument,
38
38
  SimilarMap,
39
- SchemaCoverage,
40
- } from '@graphql-inspector/core';
39
+ SchemaCoverage
40
+ } from '@graphql-inspector/core'
41
41
 
42
42
  // diff
43
- const changes: Change[] = diff(schemaA, schemaB);
43
+ const changes: Change[] = diff(schemaA, schemaB)
44
44
  // validate
45
- const invalid: InvalidDocument[] = validate(documentsGlob, schema);
45
+ const invalid: InvalidDocument[] = validate(documentsGlob, schema)
46
46
  // similar
47
- const similar: SimilarMap = similar(schema, typename, threshold);
47
+ const similar: SimilarMap = similar(schema, typename, threshold)
48
48
  // coverage
49
- const schemaCoverage: SchemaCoverage = coverage(schema, documents);
49
+ const schemaCoverage: SchemaCoverage = coverage(schema, documents)
50
50
  // ...
51
51
  ```
52
52
 
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { diff, DiffRule, Rule, CompletionArgs, CompletionHandler, UsageHandler } from './diff';
1
+ export { diff, DiffRule, Rule, CompletionArgs, CompletionHandler, UsageHandler, } from './diff';
2
2
  export { validate, InvalidDocument } from './validate';
3
3
  export { similar, SimilarMap } from './similar';
4
4
  export * from './coverage';
package/index.js CHANGED
@@ -86,7 +86,7 @@ function isDeprecated(fieldOrEnumValue) {
86
86
  if (fieldOrEnumValue.deprecationReason != null) {
87
87
  return true;
88
88
  }
89
- if ((_b = (_a = fieldOrEnumValue.astNode) === null || _a === void 0 ? void 0 : _a.directives) === null || _b === void 0 ? void 0 : _b.some(directive => directive.name.value === "deprecated")) {
89
+ if ((_b = (_a = fieldOrEnumValue.astNode) === null || _a === void 0 ? void 0 : _a.directives) === null || _b === void 0 ? void 0 : _b.some((directive) => directive.name.value === 'deprecated')) {
90
90
  return true;
91
91
  }
92
92
  return false;
@@ -573,7 +573,7 @@ function changesInEnum(oldEnum, newEnum, addChange) {
573
573
  addChange(enumValueDeprecationReasonChanged(newEnum, oldValue, newValue));
574
574
  }
575
575
  }
576
- }
576
+ },
577
577
  });
578
578
  }
579
579
 
@@ -970,10 +970,7 @@ function wordLetterPairs(str) {
970
970
  return flattenDeep(pairs);
971
971
  }
972
972
  function safeString(obj) {
973
- if (obj != null && typeof obj.toString === 'function') {
974
- return `${obj}`;
975
- }
976
- return inspect(obj);
973
+ return inspect(obj).replace(/\[Object\: null prototype\] /g, '');
977
974
  }
978
975
 
979
976
  function fieldArgumentDescriptionChanged(type, field, oldArg, newArg) {
@@ -1081,7 +1078,7 @@ function changesInField(type, oldField, newField, addChange) {
1081
1078
  },
1082
1079
  onMutual(arg) {
1083
1080
  changesInArgument(type, oldField, arg.oldVersion, arg.newVersion, addChange);
1084
- }
1081
+ },
1085
1082
  });
1086
1083
  }
1087
1084
 
package/index.mjs CHANGED
@@ -80,7 +80,7 @@ function isDeprecated(fieldOrEnumValue) {
80
80
  if (fieldOrEnumValue.deprecationReason != null) {
81
81
  return true;
82
82
  }
83
- if ((_b = (_a = fieldOrEnumValue.astNode) === null || _a === void 0 ? void 0 : _a.directives) === null || _b === void 0 ? void 0 : _b.some(directive => directive.name.value === "deprecated")) {
83
+ if ((_b = (_a = fieldOrEnumValue.astNode) === null || _a === void 0 ? void 0 : _a.directives) === null || _b === void 0 ? void 0 : _b.some((directive) => directive.name.value === 'deprecated')) {
84
84
  return true;
85
85
  }
86
86
  return false;
@@ -569,7 +569,7 @@ function changesInEnum(oldEnum, newEnum, addChange) {
569
569
  addChange(enumValueDeprecationReasonChanged(newEnum, oldValue, newValue));
570
570
  }
571
571
  }
572
- }
572
+ },
573
573
  });
574
574
  }
575
575
 
@@ -966,10 +966,7 @@ function wordLetterPairs(str) {
966
966
  return flattenDeep(pairs);
967
967
  }
968
968
  function safeString(obj) {
969
- if (obj != null && typeof obj.toString === 'function') {
970
- return `${obj}`;
971
- }
972
- return inspect(obj);
969
+ return inspect(obj).replace(/\[Object\: null prototype\] /g, '');
973
970
  }
974
971
 
975
972
  function fieldArgumentDescriptionChanged(type, field, oldArg, newArg) {
@@ -1077,7 +1074,7 @@ function changesInField(type, oldField, newField, addChange) {
1077
1074
  },
1078
1075
  onMutual(arg) {
1079
1076
  changesInArgument(type, oldField, arg.oldVersion, arg.newVersion, addChange);
1080
- }
1077
+ },
1081
1078
  });
1082
1079
  }
1083
1080
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-inspector/core",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -1,2 +1,2 @@
1
- import { GraphQLEnumValue, GraphQLField } from "graphql";
1
+ import { GraphQLEnumValue, GraphQLField } from 'graphql';
2
2
  export declare function isDeprecated(fieldOrEnumValue: GraphQLField<any, any> | GraphQLEnumValue): boolean;