@graphql-inspector/core 0.0.0-canary.f71f99b → 0.0.0-canary.fec2df4
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 +11 -9
- package/ast/document.d.ts +12 -12
- package/coverage/index.d.ts +9 -0
- package/coverage/output/json.d.ts +1 -1
- package/diff/argument.d.ts +3 -13
- package/diff/changes/argument.d.ts +5 -25
- package/diff/changes/change.d.ts +2 -0
- package/diff/changes/directive.d.ts +10 -41
- package/diff/changes/enum.d.ts +8 -20
- package/diff/changes/field.d.ts +15 -64
- package/diff/changes/input.d.ts +9 -33
- package/diff/changes/object.d.ts +4 -10
- package/diff/changes/schema.d.ts +5 -14
- package/diff/changes/union.d.ts +4 -10
- package/diff/directive.d.ts +2 -2
- package/diff/enum.d.ts +2 -2
- package/diff/field.d.ts +2 -2
- package/diff/index.d.ts +5 -8
- package/diff/input.d.ts +2 -2
- package/diff/interface.d.ts +2 -2
- package/diff/object.d.ts +2 -2
- package/diff/rules/config.d.ts +2 -0
- package/diff/rules/consider-usage.d.ts +29 -0
- package/diff/rules/dangerous-breaking.d.ts +2 -0
- package/diff/rules/index.d.ts +3 -0
- package/diff/rules/safe-unreachable.d.ts +2 -0
- package/diff/rules/types.d.ts +8 -7
- package/diff/schema.d.ts +1 -0
- package/diff/union.d.ts +2 -2
- package/index.d.ts +11 -11
- package/index.js +1992 -0
- package/index.mjs +1978 -0
- package/package.json +16 -5
- package/utils/apollo.d.ts +4 -11
- package/utils/compare.d.ts +22 -0
- package/utils/graphql.d.ts +1 -0
- package/utils/isDeprecated.d.ts +2 -0
- package/{diff/common → utils}/path.d.ts +0 -0
- package/utils/string.d.ts +1 -0
- package/validate/alias-count.d.ts +10 -0
- package/validate/complexity.d.ts +16 -0
- package/validate/directive-count.d.ts +10 -0
- package/validate/index.d.ts +12 -2
- package/validate/query-depth.d.ts +2 -1
- package/validate/token-count.d.ts +5 -0
- package/diff/common/compare.d.ts +0 -3
- package/index.cjs.js +0 -1688
- package/index.cjs.js.map +0 -1
- package/index.esm.js +0 -1681
- package/index.esm.js.map +0 -1
- package/utils/arrays.d.ts +0 -2
package/README.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
[](https://circleci.com/gh/kamilkisiela/graphql-inspector)
|
|
4
4
|
[](https://npmjs.com/package/@graphql-inspector/core)
|
|
5
5
|
|
|
6
|
-
**GraphQL Inspector** ouputs a list of changes between two GraphQL schemas. Every change is precisely explained and
|
|
7
|
-
It helps you validate documents and fragments against a schema and even
|
|
6
|
+
**GraphQL Inspector** ouputs a list of changes between two GraphQL schemas. Every change is precisely explained and
|
|
7
|
+
marked as breaking, non-breaking or dangerous. It helps you validate documents and fragments against a schema and even
|
|
8
|
+
find similar or duplicated types.
|
|
8
9
|
|
|
9
10
|
## Features
|
|
10
11
|
|
|
@@ -17,7 +18,8 @@ Major features:
|
|
|
17
18
|
- **Schema coverage based on documents**
|
|
18
19
|
- **Serves a GraphQL server with faked data and GraphQL Playground**
|
|
19
20
|
|
|
20
|
-
GraphQL Inspector has a **CLI** and also a **programatic API**, so you can use it however you want to and even build
|
|
21
|
+
GraphQL Inspector has a **CLI** and also a **programatic API**, so you can use it however you want to and even build
|
|
22
|
+
tools on top of it.
|
|
21
23
|
|
|
22
24
|
## Installation
|
|
23
25
|
|
|
@@ -36,17 +38,17 @@ import {
|
|
|
36
38
|
Change,
|
|
37
39
|
InvalidDocument,
|
|
38
40
|
SimilarMap,
|
|
39
|
-
SchemaCoverage
|
|
40
|
-
} from '@graphql-inspector/core'
|
|
41
|
+
SchemaCoverage
|
|
42
|
+
} from '@graphql-inspector/core'
|
|
41
43
|
|
|
42
44
|
// diff
|
|
43
|
-
const changes: Change[] = diff(schemaA, schemaB)
|
|
45
|
+
const changes: Change[] = diff(schemaA, schemaB)
|
|
44
46
|
// validate
|
|
45
|
-
const invalid: InvalidDocument[] = validate(documentsGlob, schema)
|
|
47
|
+
const invalid: InvalidDocument[] = validate(documentsGlob, schema)
|
|
46
48
|
// similar
|
|
47
|
-
const similar: SimilarMap = similar(schema, typename, threshold)
|
|
49
|
+
const similar: SimilarMap = similar(schema, typename, threshold)
|
|
48
50
|
// coverage
|
|
49
|
-
const schemaCoverage: SchemaCoverage = coverage(schema, documents)
|
|
51
|
+
const schemaCoverage: SchemaCoverage = coverage(schema, documents)
|
|
50
52
|
// ...
|
|
51
53
|
```
|
|
52
54
|
|
package/ast/document.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {OperationDefinitionNode, FragmentDefinitionNode, Source} from 'graphql';
|
|
1
|
+
import { OperationDefinitionNode, FragmentDefinitionNode, Source } from 'graphql';
|
|
2
2
|
export interface Document {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
source: Source;
|
|
4
|
+
fragments: {
|
|
5
|
+
node: FragmentDefinitionNode;
|
|
6
|
+
source: string;
|
|
7
|
+
}[];
|
|
8
|
+
operations: {
|
|
9
|
+
node: OperationDefinitionNode;
|
|
10
|
+
source: string;
|
|
11
|
+
}[];
|
|
12
|
+
hasFragments: boolean;
|
|
13
|
+
hasOperations: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare function readDocument(source: Source): Document;
|
package/coverage/index.d.ts
CHANGED
|
@@ -3,11 +3,20 @@ export interface Location {
|
|
|
3
3
|
start: number;
|
|
4
4
|
end: number;
|
|
5
5
|
}
|
|
6
|
+
export interface ArgumentCoverage {
|
|
7
|
+
hits: number;
|
|
8
|
+
locations: {
|
|
9
|
+
[name: string]: Array<Location>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
6
12
|
export interface TypeChildCoverage {
|
|
7
13
|
hits: number;
|
|
8
14
|
locations: {
|
|
9
15
|
[name: string]: Array<Location>;
|
|
10
16
|
};
|
|
17
|
+
children: {
|
|
18
|
+
[name: string]: ArgumentCoverage;
|
|
19
|
+
};
|
|
11
20
|
}
|
|
12
21
|
export interface TypeCoverage {
|
|
13
22
|
hits: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {SchemaCoverage} from '../index';
|
|
1
|
+
import { SchemaCoverage } from '../index';
|
|
2
2
|
export declare function outputJSON(coverage: SchemaCoverage): string;
|
package/diff/argument.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
GraphQLField,
|
|
5
|
-
GraphQLInterfaceType,
|
|
6
|
-
} from 'graphql';
|
|
7
|
-
import {Change} from './changes/change';
|
|
8
|
-
export declare function changesInArgument(
|
|
9
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
10
|
-
field: GraphQLField<any, any, any>,
|
|
11
|
-
oldArg: GraphQLArgument,
|
|
12
|
-
newArg: GraphQLArgument,
|
|
13
|
-
): Change[];
|
|
1
|
+
import { GraphQLArgument, GraphQLObjectType, GraphQLField, GraphQLInterfaceType } from 'graphql';
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInArgument(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, oldArg: GraphQLArgument, newArg: GraphQLArgument, addChange: AddChange): void;
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from 'graphql';
|
|
7
|
-
import {Change} from './change';
|
|
8
|
-
export declare function fieldArgumentDescriptionChanged(
|
|
9
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
10
|
-
field: GraphQLField<any, any, any>,
|
|
11
|
-
oldArg: GraphQLArgument,
|
|
12
|
-
newArg: GraphQLArgument,
|
|
13
|
-
): Change;
|
|
14
|
-
export declare function fieldArgumentDefaultChanged(
|
|
15
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
16
|
-
field: GraphQLField<any, any, any>,
|
|
17
|
-
oldArg: GraphQLArgument,
|
|
18
|
-
newArg: GraphQLArgument,
|
|
19
|
-
): Change;
|
|
20
|
-
export declare function fieldArgumentTypeChanged(
|
|
21
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
22
|
-
field: GraphQLField<any, any, any>,
|
|
23
|
-
oldArg: GraphQLArgument,
|
|
24
|
-
newArg: GraphQLArgument,
|
|
25
|
-
): Change;
|
|
1
|
+
import { GraphQLArgument, GraphQLObjectType, GraphQLField, GraphQLInterfaceType } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
3
|
+
export declare function fieldArgumentDescriptionChanged(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, oldArg: GraphQLArgument, newArg: GraphQLArgument): Change;
|
|
4
|
+
export declare function fieldArgumentDefaultChanged(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, oldArg: GraphQLArgument, newArg: GraphQLArgument): Change;
|
|
5
|
+
export declare function fieldArgumentTypeChanged(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, oldArg: GraphQLArgument, newArg: GraphQLArgument): Change;
|
package/diff/changes/change.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export declare enum ChangeType {
|
|
|
16
16
|
EnumValueAdded = "ENUM_VALUE_ADDED",
|
|
17
17
|
EnumValueDescriptionChanged = "ENUM_VALUE_DESCRIPTION_CHANGED",
|
|
18
18
|
EnumValueDeprecationReasonChanged = "ENUM_VALUE_DEPRECATION_REASON_CHANGED",
|
|
19
|
+
EnumValueDeprecationReasonAdded = "ENUM_VALUE_DEPRECATION_REASON_ADDED",
|
|
20
|
+
EnumValueDeprecationReasonRemoved = "ENUM_VALUE_DEPRECATION_REASON_REMOVED",
|
|
19
21
|
FieldRemoved = "FIELD_REMOVED",
|
|
20
22
|
FieldAdded = "FIELD_ADDED",
|
|
21
23
|
FieldDescriptionChanged = "FIELD_DESCRIPTION_CHANGED",
|
|
@@ -1,43 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
DirectiveLocationEnum,
|
|
4
|
-
GraphQLArgument,
|
|
5
|
-
} from 'graphql';
|
|
6
|
-
import {Change} from './change';
|
|
1
|
+
import { GraphQLDirective, DirectiveLocationEnum, GraphQLArgument } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
7
3
|
export declare function directiveRemoved(directive: GraphQLDirective): Change;
|
|
8
4
|
export declare function directiveAdded(directive: GraphQLDirective): Change;
|
|
9
|
-
export declare function directiveDescriptionChanged(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
): Change;
|
|
13
|
-
export declare function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
): Change;
|
|
17
|
-
export declare function directiveLocationRemoved(
|
|
18
|
-
directive: GraphQLDirective,
|
|
19
|
-
location: DirectiveLocationEnum,
|
|
20
|
-
): Change;
|
|
21
|
-
export declare function directiveArgumentAdded(
|
|
22
|
-
directive: GraphQLDirective,
|
|
23
|
-
arg: GraphQLArgument,
|
|
24
|
-
): Change;
|
|
25
|
-
export declare function directiveArgumentRemoved(
|
|
26
|
-
directive: GraphQLDirective,
|
|
27
|
-
arg: GraphQLArgument,
|
|
28
|
-
): Change;
|
|
29
|
-
export declare function directiveArgumentDescriptionChanged(
|
|
30
|
-
directive: GraphQLDirective,
|
|
31
|
-
oldArg: GraphQLArgument,
|
|
32
|
-
newArg: GraphQLArgument,
|
|
33
|
-
): Change;
|
|
34
|
-
export declare function directiveArgumentDefaultValueChanged(
|
|
35
|
-
directive: GraphQLDirective,
|
|
36
|
-
oldArg: GraphQLArgument,
|
|
37
|
-
newArg: GraphQLArgument,
|
|
38
|
-
): Change;
|
|
39
|
-
export declare function directiveArgumentTypeChanged(
|
|
40
|
-
directive: GraphQLDirective,
|
|
41
|
-
oldArg: GraphQLArgument,
|
|
42
|
-
newArg: GraphQLArgument,
|
|
43
|
-
): Change;
|
|
5
|
+
export declare function directiveDescriptionChanged(oldDirective: GraphQLDirective, newDirective: GraphQLDirective): Change;
|
|
6
|
+
export declare function directiveLocationAdded(directive: GraphQLDirective, location: DirectiveLocationEnum): Change;
|
|
7
|
+
export declare function directiveLocationRemoved(directive: GraphQLDirective, location: DirectiveLocationEnum): Change;
|
|
8
|
+
export declare function directiveArgumentAdded(directive: GraphQLDirective, arg: GraphQLArgument): Change;
|
|
9
|
+
export declare function directiveArgumentRemoved(directive: GraphQLDirective, arg: GraphQLArgument): Change;
|
|
10
|
+
export declare function directiveArgumentDescriptionChanged(directive: GraphQLDirective, oldArg: GraphQLArgument, newArg: GraphQLArgument): Change;
|
|
11
|
+
export declare function directiveArgumentDefaultValueChanged(directive: GraphQLDirective, oldArg: GraphQLArgument, newArg: GraphQLArgument): Change;
|
|
12
|
+
export declare function directiveArgumentTypeChanged(directive: GraphQLDirective, oldArg: GraphQLArgument, newArg: GraphQLArgument): Change;
|
package/diff/changes/enum.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import {GraphQLEnumType, GraphQLEnumValue} from 'graphql';
|
|
2
|
-
import {Change} from './change';
|
|
3
|
-
export declare function enumValueRemoved(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
): Change;
|
|
7
|
-
export declare function
|
|
8
|
-
|
|
9
|
-
value: GraphQLEnumValue,
|
|
10
|
-
): Change;
|
|
11
|
-
export declare function enumValueDescriptionChanged(
|
|
12
|
-
newEnum: GraphQLEnumType,
|
|
13
|
-
oldValue: GraphQLEnumValue,
|
|
14
|
-
newValue: GraphQLEnumValue,
|
|
15
|
-
): Change;
|
|
16
|
-
export declare function enumValueDeprecationReasonChanged(
|
|
17
|
-
newEnum: GraphQLEnumType,
|
|
18
|
-
oldValue: GraphQLEnumValue,
|
|
19
|
-
newValue: GraphQLEnumValue,
|
|
20
|
-
): Change;
|
|
1
|
+
import { GraphQLEnumType, GraphQLEnumValue } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
3
|
+
export declare function enumValueRemoved(oldEnum: GraphQLEnumType, value: GraphQLEnumValue): Change;
|
|
4
|
+
export declare function enumValueAdded(newEnum: GraphQLEnumType, value: GraphQLEnumValue): Change;
|
|
5
|
+
export declare function enumValueDescriptionChanged(newEnum: GraphQLEnumType, oldValue: GraphQLEnumValue, newValue: GraphQLEnumValue): Change;
|
|
6
|
+
export declare function enumValueDeprecationReasonChanged(newEnum: GraphQLEnumType, oldValue: GraphQLEnumValue, newValue: GraphQLEnumValue): Change;
|
|
7
|
+
export declare function enumValueDeprecationReasonAdded(newEnum: GraphQLEnumType, oldValue: GraphQLEnumValue, newValue: GraphQLEnumValue): Change;
|
|
8
|
+
export declare function enumValueDeprecationReasonRemoved(newEnum: GraphQLEnumType, oldValue: GraphQLEnumValue, newValue: GraphQLEnumValue): Change;
|
package/diff/changes/field.d.ts
CHANGED
|
@@ -1,64 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
): Change;
|
|
12
|
-
export declare function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
): Change;
|
|
16
|
-
export declare function fieldDescriptionChanged(
|
|
17
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
18
|
-
oldField: GraphQLField<any, any>,
|
|
19
|
-
newField: GraphQLField<any, any>,
|
|
20
|
-
): Change;
|
|
21
|
-
export declare function fieldDescriptionAdded(
|
|
22
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
23
|
-
field: GraphQLField<any, any>,
|
|
24
|
-
): Change;
|
|
25
|
-
export declare function fieldDescriptionRemoved(
|
|
26
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
27
|
-
field: GraphQLField<any, any>,
|
|
28
|
-
): Change;
|
|
29
|
-
export declare function fieldDeprecationAdded(
|
|
30
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
31
|
-
field: GraphQLField<any, any>,
|
|
32
|
-
): Change;
|
|
33
|
-
export declare function fieldDeprecationRemoved(
|
|
34
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
35
|
-
field: GraphQLField<any, any>,
|
|
36
|
-
): Change;
|
|
37
|
-
export declare function fieldDeprecationReasonChanged(
|
|
38
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
39
|
-
oldField: GraphQLField<any, any>,
|
|
40
|
-
newField: GraphQLField<any, any>,
|
|
41
|
-
): Change;
|
|
42
|
-
export declare function fieldDeprecationReasonAdded(
|
|
43
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
44
|
-
field: GraphQLField<any, any>,
|
|
45
|
-
): Change;
|
|
46
|
-
export declare function fieldDeprecationReasonRemoved(
|
|
47
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
48
|
-
field: GraphQLField<any, any>,
|
|
49
|
-
): Change;
|
|
50
|
-
export declare function fieldTypeChanged(
|
|
51
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
52
|
-
oldField: GraphQLField<any, any, any>,
|
|
53
|
-
newField: GraphQLField<any, any, any>,
|
|
54
|
-
): Change;
|
|
55
|
-
export declare function fieldArgumentAdded(
|
|
56
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
57
|
-
field: GraphQLField<any, any, any>,
|
|
58
|
-
arg: GraphQLArgument,
|
|
59
|
-
): Change;
|
|
60
|
-
export declare function fieldArgumentRemoved(
|
|
61
|
-
type: GraphQLObjectType | GraphQLInterfaceType,
|
|
62
|
-
field: GraphQLField<any, any, any>,
|
|
63
|
-
arg: GraphQLArgument,
|
|
64
|
-
): Change;
|
|
1
|
+
import { GraphQLObjectType, GraphQLField, GraphQLArgument, GraphQLInterfaceType } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
3
|
+
export declare function fieldRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>): Change;
|
|
4
|
+
export declare function fieldAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>): Change;
|
|
5
|
+
export declare function fieldDescriptionChanged(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any>, newField: GraphQLField<any, any>): Change;
|
|
6
|
+
export declare function fieldDescriptionAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change;
|
|
7
|
+
export declare function fieldDescriptionRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change;
|
|
8
|
+
export declare function fieldDeprecationAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change;
|
|
9
|
+
export declare function fieldDeprecationRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change;
|
|
10
|
+
export declare function fieldDeprecationReasonChanged(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any>, newField: GraphQLField<any, any>): Change;
|
|
11
|
+
export declare function fieldDeprecationReasonAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change;
|
|
12
|
+
export declare function fieldDeprecationReasonRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any>): Change;
|
|
13
|
+
export declare function fieldTypeChanged(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any, any>, newField: GraphQLField<any, any, any>): Change;
|
|
14
|
+
export declare function fieldArgumentAdded(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, arg: GraphQLArgument): Change;
|
|
15
|
+
export declare function fieldArgumentRemoved(type: GraphQLObjectType | GraphQLInterfaceType, field: GraphQLField<any, any, any>, arg: GraphQLArgument): Change;
|
package/diff/changes/input.d.ts
CHANGED
|
@@ -1,33 +1,9 @@
|
|
|
1
|
-
import {GraphQLInputObjectType, GraphQLInputField} from 'graphql';
|
|
2
|
-
import {Change} from './change';
|
|
3
|
-
export declare function inputFieldRemoved(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
): Change;
|
|
7
|
-
export declare function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
): Change;
|
|
11
|
-
export declare function inputFieldDescriptionAdded(
|
|
12
|
-
type: GraphQLInputObjectType,
|
|
13
|
-
field: GraphQLInputField,
|
|
14
|
-
): Change;
|
|
15
|
-
export declare function inputFieldDescriptionRemoved(
|
|
16
|
-
type: GraphQLInputObjectType,
|
|
17
|
-
field: GraphQLInputField,
|
|
18
|
-
): Change;
|
|
19
|
-
export declare function inputFieldDescriptionChanged(
|
|
20
|
-
input: GraphQLInputObjectType,
|
|
21
|
-
oldField: GraphQLInputField,
|
|
22
|
-
newField: GraphQLInputField,
|
|
23
|
-
): Change;
|
|
24
|
-
export declare function inputFieldDefaultValueChanged(
|
|
25
|
-
input: GraphQLInputObjectType,
|
|
26
|
-
oldField: GraphQLInputField,
|
|
27
|
-
newField: GraphQLInputField,
|
|
28
|
-
): Change;
|
|
29
|
-
export declare function inputFieldTypeChanged(
|
|
30
|
-
input: GraphQLInputObjectType,
|
|
31
|
-
oldField: GraphQLInputField,
|
|
32
|
-
newField: GraphQLInputField,
|
|
33
|
-
): Change;
|
|
1
|
+
import { GraphQLInputObjectType, GraphQLInputField } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
3
|
+
export declare function inputFieldRemoved(input: GraphQLInputObjectType, field: GraphQLInputField): Change;
|
|
4
|
+
export declare function inputFieldAdded(input: GraphQLInputObjectType, field: GraphQLInputField): Change;
|
|
5
|
+
export declare function inputFieldDescriptionAdded(type: GraphQLInputObjectType, field: GraphQLInputField): Change;
|
|
6
|
+
export declare function inputFieldDescriptionRemoved(type: GraphQLInputObjectType, field: GraphQLInputField): Change;
|
|
7
|
+
export declare function inputFieldDescriptionChanged(input: GraphQLInputObjectType, oldField: GraphQLInputField, newField: GraphQLInputField): Change;
|
|
8
|
+
export declare function inputFieldDefaultValueChanged(input: GraphQLInputObjectType, oldField: GraphQLInputField, newField: GraphQLInputField): Change;
|
|
9
|
+
export declare function inputFieldTypeChanged(input: GraphQLInputObjectType, oldField: GraphQLInputField, newField: GraphQLInputField): Change;
|
package/diff/changes/object.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {GraphQLInterfaceType, GraphQLObjectType} from 'graphql';
|
|
2
|
-
import {Change} from './change';
|
|
3
|
-
export declare function objectTypeInterfaceAdded(
|
|
4
|
-
|
|
5
|
-
type: GraphQLObjectType,
|
|
6
|
-
): Change;
|
|
7
|
-
export declare function objectTypeInterfaceRemoved(
|
|
8
|
-
iface: GraphQLInterfaceType,
|
|
9
|
-
type: GraphQLObjectType,
|
|
10
|
-
): Change;
|
|
1
|
+
import { GraphQLInterfaceType, GraphQLObjectType } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
3
|
+
export declare function objectTypeInterfaceAdded(iface: GraphQLInterfaceType, type: GraphQLObjectType): Change;
|
|
4
|
+
export declare function objectTypeInterfaceRemoved(iface: GraphQLInterfaceType, type: GraphQLObjectType): Change;
|
package/diff/changes/schema.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {GraphQLSchema} from 'graphql';
|
|
2
|
-
import {Change} from './change';
|
|
3
|
-
export declare function schemaQueryTypeChanged(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
): Change;
|
|
7
|
-
export declare function schemaMutationTypeChanged(
|
|
8
|
-
oldSchema: GraphQLSchema,
|
|
9
|
-
newSchema: GraphQLSchema,
|
|
10
|
-
): Change;
|
|
11
|
-
export declare function schemaSubscriptionTypeChanged(
|
|
12
|
-
oldSchema: GraphQLSchema,
|
|
13
|
-
newSchema: GraphQLSchema,
|
|
14
|
-
): Change;
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
3
|
+
export declare function schemaQueryTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change;
|
|
4
|
+
export declare function schemaMutationTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change;
|
|
5
|
+
export declare function schemaSubscriptionTypeChanged(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Change;
|
package/diff/changes/union.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {GraphQLUnionType, GraphQLObjectType} from 'graphql';
|
|
2
|
-
import {Change} from './change';
|
|
3
|
-
export declare function unionMemberRemoved(
|
|
4
|
-
|
|
5
|
-
type: GraphQLObjectType,
|
|
6
|
-
): Change;
|
|
7
|
-
export declare function unionMemberAdded(
|
|
8
|
-
union: GraphQLUnionType,
|
|
9
|
-
type: GraphQLObjectType,
|
|
10
|
-
): Change;
|
|
1
|
+
import { GraphQLUnionType, GraphQLObjectType } from 'graphql';
|
|
2
|
+
import { Change } from './change';
|
|
3
|
+
export declare function unionMemberRemoved(union: GraphQLUnionType, type: GraphQLObjectType): Change;
|
|
4
|
+
export declare function unionMemberAdded(union: GraphQLUnionType, type: GraphQLObjectType): Change;
|
package/diff/directive.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLDirective } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function changesInDirective(oldDirective: GraphQLDirective, newDirective: GraphQLDirective):
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInDirective(oldDirective: GraphQLDirective, newDirective: GraphQLDirective, addChange: AddChange): void;
|
package/diff/enum.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLEnumType } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function changesInEnum(oldEnum: GraphQLEnumType, newEnum: GraphQLEnumType):
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInEnum(oldEnum: GraphQLEnumType, newEnum: GraphQLEnumType, addChange: AddChange): void;
|
package/diff/field.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLField, GraphQLObjectType, GraphQLInterfaceType } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function changesInField(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any>, newField: GraphQLField<any, any
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInField(type: GraphQLObjectType | GraphQLInterfaceType, oldField: GraphQLField<any, any>, newField: GraphQLField<any, any>, addChange: AddChange): void;
|
package/diff/index.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {GraphQLSchema} from 'graphql';
|
|
2
|
-
import {Change} from './changes/change';
|
|
3
|
-
import {Rule} from './rules/types';
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { Change } from './changes/change';
|
|
3
|
+
import { Rule } from './rules/types';
|
|
4
4
|
import * as rules from './rules';
|
|
5
5
|
export * from './rules/types';
|
|
6
6
|
export declare const DiffRule: typeof rules;
|
|
7
7
|
export * from './onComplete/types';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
newSchema: GraphQLSchema,
|
|
11
|
-
rules?: Rule[],
|
|
12
|
-
): Change[];
|
|
8
|
+
export type { UsageHandler } from './rules/consider-usage';
|
|
9
|
+
export declare function diff(oldSchema: GraphQLSchema, newSchema: GraphQLSchema, rules?: Rule[], config?: rules.ConsiderUsageConfig): Promise<Change[]>;
|
package/diff/input.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLInputObjectType } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function changesInInputObject(oldInput: GraphQLInputObjectType, newInput: GraphQLInputObjectType):
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInInputObject(oldInput: GraphQLInputObjectType, newInput: GraphQLInputObjectType, addChange: AddChange): void;
|
package/diff/interface.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLInterfaceType } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function changesInInterface(oldInterface: GraphQLInterfaceType, newInterface: GraphQLInterfaceType):
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInInterface(oldInterface: GraphQLInterfaceType, newInterface: GraphQLInterfaceType, addChange: AddChange): void;
|
package/diff/object.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLObjectType } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function changesInObject(oldType: GraphQLObjectType, newType: GraphQLObjectType):
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInObject(oldType: GraphQLObjectType, newType: GraphQLObjectType, addChange: AddChange): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Rule } from './types';
|
|
2
|
+
export declare type UsageHandler = (input: Array<{
|
|
3
|
+
type: string;
|
|
4
|
+
field?: string;
|
|
5
|
+
argument?: string;
|
|
6
|
+
}>) => Promise<boolean[]>;
|
|
7
|
+
export interface ConsiderUsageConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Checks if it's safe to introduce a breaking change on a field
|
|
10
|
+
*
|
|
11
|
+
* Because the function is async and resolves to a boolean value
|
|
12
|
+
* you can add pretty much anything here, many different conditions or
|
|
13
|
+
* even any source of data.
|
|
14
|
+
*
|
|
15
|
+
* In the CLI we use a GraphQL endpoint with a query
|
|
16
|
+
* that checks the usage and returns stats like:
|
|
17
|
+
* min/max count and min/max precentage
|
|
18
|
+
* So we know when to allow for a breaking change.
|
|
19
|
+
*
|
|
20
|
+
* Because it returns a boolean,
|
|
21
|
+
* we can't attach any data or even customize a message of an api change.
|
|
22
|
+
* This is the first iteration, we're going to improve it soon.
|
|
23
|
+
*
|
|
24
|
+
* true - NON_BREAKING
|
|
25
|
+
* false - BREAKING
|
|
26
|
+
*/
|
|
27
|
+
checkUsage?: UsageHandler;
|
|
28
|
+
}
|
|
29
|
+
export declare const considerUsage: Rule<ConsiderUsageConfig>;
|
package/diff/rules/index.d.ts
CHANGED
package/diff/rules/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {GraphQLSchema} from 'graphql';
|
|
2
|
-
import {Change} from '../changes/change';
|
|
3
|
-
export declare type Rule = (input: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { Change } from '../changes/change';
|
|
3
|
+
export declare type Rule<TConfig = any> = (input: {
|
|
4
|
+
changes: Change[];
|
|
5
|
+
oldSchema: GraphQLSchema;
|
|
6
|
+
newSchema: GraphQLSchema;
|
|
7
|
+
config: TConfig;
|
|
8
|
+
}) => Change[] | Promise<Change[]>;
|
package/diff/schema.d.ts
CHANGED
package/diff/union.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLUnionType } from 'graphql';
|
|
2
|
-
import {
|
|
3
|
-
export declare function changesInUnion(oldUnion: GraphQLUnionType, newUnion: GraphQLUnionType):
|
|
2
|
+
import { AddChange } from './schema';
|
|
3
|
+
export declare function changesInUnion(oldUnion: GraphQLUnionType, newUnion: GraphQLUnionType, addChange: AddChange): void;
|
package/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export {diff, DiffRule, Rule, CompletionArgs, CompletionHandler} from './diff';
|
|
2
|
-
export {validate, InvalidDocument} from './validate';
|
|
3
|
-
export {similar, SimilarMap} from './similar';
|
|
1
|
+
export { diff, DiffRule, Rule, CompletionArgs, CompletionHandler, UsageHandler } from './diff';
|
|
2
|
+
export { validate, InvalidDocument } from './validate';
|
|
3
|
+
export { similar, SimilarMap } from './similar';
|
|
4
4
|
export * from './coverage';
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from './
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
5
|
+
export { Change, CriticalityLevel, Criticality, ChangeType } from './diff/changes/change';
|
|
6
|
+
export { getTypePrefix } from './utils/graphql';
|
|
7
|
+
export { Target, Rating, BestMatch } from './utils/string';
|
|
8
|
+
export { countAliases } from './validate/alias-count';
|
|
9
|
+
export { countDirectives } from './validate/directive-count';
|
|
10
|
+
export { countDepth } from './validate/query-depth';
|
|
11
|
+
export { calculateOperationComplexity, CalculateOperationComplexityConfig } from './validate/complexity';
|
|
12
|
+
export { calculateTokenCount } from './validate/token-count';
|