File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 "sha.js" : " ^2.4.11"
1717 },
1818 "peerDependencies" : {
19- "graphql" : " ^14.2.1 || ^15.0.0"
19+ "graphql" : " ^14.2.1 || ^15.0.0 || ^16.0.0 "
2020 },
2121 "jest" : {
2222 "preset" : " ts-jest" ,
Original file line number Diff line number Diff line change @@ -53,11 +53,22 @@ const skippedSDLRules: ValidationRule[] = [
5353// Currently, this PossibleTypeExtensions rule is experimental and thus not
5454// exposed directly from the rules module above. This may change in the future!
5555// Additionally, it does not exist in prior graphql versions. Thus this try/catch.
56+ //
57+ // BREAKING AGAIN: PossibleTypeExtensions is finilized into PossibleTypeExtensionsRule in
58+ // graphql 16. For compatible reason, try catch logic for 15 is kept with extra logic for 16.
5659try {
60+ // Compatible for graphql@15
5761 const PossibleTypeExtensions : typeof import ( "graphql/validation/rules/PossibleTypeExtensions" ) . PossibleTypeExtensions = require ( "graphql/validation/rules/PossibleTypeExtensions" )
5862 . PossibleTypeExtensions ;
63+
64+ // Compatible for graphql@16
65+ const PossibleTypeExtensionsRule = require ( "graphql" )
66+ . PossibleTypeExtensionsRule ;
67+
5968 if ( PossibleTypeExtensions ) {
6069 skippedSDLRules . push ( PossibleTypeExtensions ) ;
70+ } else if ( PossibleTypeExtensionsRule ) {
71+ skippedSDLRules . push ( PossibleTypeExtensionsRule ) ;
6172 }
6273} catch ( e ) {
6374 // No need to fail in this case. Instead, if this validation rule is missing, we will assume its not used
You can’t perform that action at this time.
0 commit comments