File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 16
16
"sha.js" : " ^2.4.11"
17
17
},
18
18
"peerDependencies" : {
19
- "graphql" : " ^14.2.1 || ^15.0.0"
19
+ "graphql" : " ^14.2.1 || ^15.0.0 || ^16.0.0 "
20
20
},
21
21
"jest" : {
22
22
"preset" : " ts-jest" ,
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ const skippedSDLRules: ValidationRule[] = [
56
56
try {
57
57
const PossibleTypeExtensions : typeof import ( "graphql/validation/rules/PossibleTypeExtensions" ) . PossibleTypeExtensions = require ( "graphql/validation/rules/PossibleTypeExtensions" )
58
58
. PossibleTypeExtensions ;
59
+
59
60
if ( PossibleTypeExtensions ) {
60
61
skippedSDLRules . push ( PossibleTypeExtensions ) ;
61
62
}
64
65
// by the version of `graphql` that is available to us.
65
66
}
66
67
68
+ // BREAKING AGAIN: PossibleTypeExtensions is finilized into PossibleTypeExtensionsRule in
69
+ // graphql 16. For compatible reason, try catch logic for 15 is kept with extra logic for 16.
70
+ try {
71
+ // Compatible for graphql-js@16
72
+ const PossibleTypeExtensionsRule = require ( "graphql" )
73
+ . PossibleTypeExtensionsRule ;
74
+
75
+ if ( PossibleTypeExtensionsRule ) {
76
+ skippedSDLRules . push ( PossibleTypeExtensionsRule ) ;
77
+ }
78
+ } catch ( e ) {
79
+ // No need to fail in this case. Instead, if this validation rule is missing, we will assume its not used
80
+ // by the version of `graphql` that is available to us.
81
+ }
82
+
67
83
const sdlRules = specifiedSDLRules . filter (
68
84
rule => ! skippedSDLRules . includes ( rule )
69
85
) ;
You can’t perform that action at this time.
0 commit comments