@graphql-eslint/eslint-plugin 3.16.2-alpha-20230316061052-f906c24 → 3.16.2-alpha-20230316063229-8463019
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.
@@ -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