Skip to content

Commit bd2e4f4

Browse files
authored
Fix regression introduced in #2100 (#2129)
Fixes #2128
1 parent 6a6e5b1 commit bd2e4f4

File tree

17 files changed

+39455
-2882
lines changed

17 files changed

+39455
-2882
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
### vNEXT
44

5+
- **core**: Fix regression [#2128](https://github.com/kamilkisiela/graphql-inspector/issues/2128) introduced in [#2100](https://github.com/kamilkisiela/graphql-inspector/pull/2100)
6+
57
### v3.1.3
68

79
- **core**: Fix missing export of `safeUnreachable` rule [#2063](https://github.com/kamilkisiela/graphql-inspector/issues/2063)
8-
- **core**: Fix equality for objects [#2100](https://github.com/kamilkisiela/graphql-inspector/pull/2100)
10+
- **core**: Fix equality for objects [#2100](https://github.com/kamilkisiela/graphql-inspector/pull/2100)
911

1012
### v3.1.2
1113

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
It helps you validate documents and fragments against a schema and even find similar or duplicated types.
1111

1212
> You may like [GraphQL Hive](https://graphql-hive.com) as well!
13-
>
13+
>
1414
> It's an open-source performance monitoring tool and schema registry for GraphQL.
15-
>
15+
>
1616
> GraphQL Hive is currently available as a hosted service but it offers self-hosting as well.
1717
1818
Use GraphQL Inspector however you want:

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ inputs:
3636
description: |
3737
Merge Pull Request's branch with the target branch to get the schema.
3838
Helps to get the correct state of schema when Pull Request is behind the target branch
39-
39+
4040
(enabled by default)
4141
outputs:
4242
changes:

action/index.js

Lines changed: 39339 additions & 1 deletion
Large diffs are not rendered by default.

lerna.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"@sentry/tracing": "6.10.0",
6868
"husky": "4.3.8",
6969
"immer": "9.0.6",
70-
"lerna": "4.0.0",
7170
"probot": "11.3.0",
7271
"shelljs": "0.8.5"
7372
},

packages/core/__tests__/utils/compare.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ test('isEqual', () => {
77
expect(isEqual(1, 1)).toBe(true);
88
expect(isEqual(1, 1.0)).toBe(true);
99

10+
expect(isEqual(undefined, 1)).toBe(false);
11+
expect(isEqual(null, 1)).toBe(false);
12+
expect(isEqual(null, null)).toBe(true);
13+
1014
expect(isEqual(['a'], ['a'])).toBe(true);
1115
expect(isEqual(['a'], ['A'])).toBe(false);
1216
expect(isEqual(['a'], [''])).toBe(false);

packages/core/__tests__/utils/string.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ test('undefined', () => {
2121

2222
test('object', () => {
2323
expect(safeString({})).toBe('{}');
24-
expect(safeString(Object.create(null, { foo: { value: 42, enumerable: true } }))).toBe('{ foo: 42 }');
24+
expect(
25+
safeString(Object.create(null, { foo: { value: 42, enumerable: true } })),
26+
).toBe('{ foo: 42 }');
2527
});
2628

2729
test('array', () => {
2830
expect(safeString(['42', '42'])).toBe("[ '42', '42' ]");
2931
expect(safeString([{}])).toBe('[ {} ]');
30-
expect(safeString([Object.create(null, { foo: { value: 42, enumerable: true } })])).toBe('[ { foo: 42 } ]');
32+
expect(
33+
safeString([Object.create(null, { foo: { value: 42, enumerable: true } })]),
34+
).toBe('[ { foo: 42 } ]');
3135
});

packages/core/src/utils/compare.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function isEqual<T>(a: T, b: T): boolean {
2121
return true;
2222
}
2323

24-
if (typeof a === 'object' && typeof b === 'object') {
24+
if (a && b && typeof a === 'object' && typeof b === 'object') {
2525
const aRecord = a as Record<string, unknown>;
2626
const bRecord = b as Record<string, unknown>;
2727

@@ -35,8 +35,8 @@ export function isEqual<T>(a: T, b: T): boolean {
3535
return false;
3636
}
3737
}
38-
39-
return true
38+
39+
return true;
4040
}
4141

4242
return a === b || (!a && !b);

website/docs/api/schema.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ GraphQL Inspector accepts CommonJS and ESModules
1212

1313
```js
1414
// Example for loading and merging multiple .graphql files into a single schema
15-
const { makeExecutableSchema } = require("@graphql-tools/schema");
16-
const { loadFilesSync } = require('@graphql-tools/load-files');
15+
const { makeExecutableSchema } = require('@graphql-tools/schema')
16+
const { loadFilesSync } = require('@graphql-tools/load-files')
1717

18-
const typeDefs = loadFilesSync('**/*.graphql');
18+
const typeDefs = loadFilesSync('**/*.graphql')
1919

2020
module.exports = makeExecutableSchema({ typeDefs })
2121
```
2222

2323
**ESM default export**
2424

2525
```ts
26-
import { makeExecutableSchema } from "@graphql-tools/schema";
27-
import { typeDefs } from "./type-defs";
26+
import { makeExecutableSchema } from '@graphql-tools/schema'
27+
import { typeDefs } from './type-defs'
2828

2929
// as `default`
3030
export default makeExecutableSchema({ typeDefs })
@@ -33,8 +33,8 @@ export default makeExecutableSchema({ typeDefs })
3333
**ESM named export**
3434

3535
```ts
36-
import { makeExecutableSchema } from "@graphql-tools/schema";
37-
import { typeDefs } from "./type-defs";
36+
import { makeExecutableSchema } from '@graphql-tools/schema'
37+
import { typeDefs } from './type-defs'
3838

3939
// as `schema` variables
4040
export const schema = makeExecutableSchema({ typeDefs })

0 commit comments

Comments
 (0)