@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
- const { specifiedRules } = require('graphql');
115
- ruleFn = specifiedRules.find((ruleFn) => ruleFn.name === ruleKey);
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
- const { specifiedRules } = require('graphql');
114
- ruleFn = specifiedRules.find((ruleFn) => ruleFn.name === ruleKey);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "3.16.2-alpha-20230316061943-b3c71ef",
3
+ "version": "3.16.2-alpha-20230316063229-8463019",
4
4
  "description": "GraphQL plugin for ESLint",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {