@graphql-eslint/eslint-plugin 3.16.2-alpha-20230316061943-b3c71ef → 3.16.2-alpha-20230316063229-8463019
Sign up to get free protection for your applications and to get access to all the features.
@@ -111,14 +111,16 @@ const validationToRule = ({ ruleId, ruleName, getDocumentNode, schema = [], hasD
|
|
111
111
|
ruleFn = require('graphql/validation')[ruleKey];
|
112
112
|
}
|
113
113
|
catch (_c) {
|
114
|
-
|
115
|
-
|
114
|
+
try {
|
115
|
+
const { specifiedRules } = require('graphql');
|
116
|
+
ruleFn = specifiedRules.find((ruleFn) => ruleFn.name === ruleKey);
|
117
|
+
}
|
118
|
+
catch (_d) {
|
119
|
+
ruleFn = null;
|
120
|
+
}
|
116
121
|
}
|
117
122
|
}
|
118
123
|
}
|
119
|
-
if (!ruleFn) {
|
120
|
-
throw new Error(`Failed to locate rule "${ruleName}" in "graphql-js" package!`);
|
121
|
-
}
|
122
124
|
return {
|
123
125
|
[ruleId]: {
|
124
126
|
meta: {
|
@@ -110,14 +110,16 @@ const validationToRule = ({ ruleId, ruleName, getDocumentNode, schema = [], hasD
|
|
110
110
|
ruleFn = require('graphql/validation')[ruleKey];
|
111
111
|
}
|
112
112
|
catch (_c) {
|
113
|
-
|
114
|
-
|
113
|
+
try {
|
114
|
+
const { specifiedRules } = require('graphql');
|
115
|
+
ruleFn = specifiedRules.find((ruleFn) => ruleFn.name === ruleKey);
|
116
|
+
}
|
117
|
+
catch (_d) {
|
118
|
+
ruleFn = null;
|
119
|
+
}
|
115
120
|
}
|
116
121
|
}
|
117
122
|
}
|
118
|
-
if (!ruleFn) {
|
119
|
-
throw new Error(`Failed to locate rule "${ruleName}" in "graphql-js" package!`);
|
120
|
-
}
|
121
123
|
return {
|
122
124
|
[ruleId]: {
|
123
125
|
meta: {
|
package/package.json
CHANGED