@envelop/depth-limit 1.6.0-alpha-e9434aa.0 → 1.6.0-alpha-731c100.0
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.
- package/esm/index.js +3 -10
- package/package.json +2 -2
package/esm/index.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useDepthLimit = void 0;
|
|
7
|
-
const graphql_depth_limit_1 = __importDefault(require("graphql-depth-limit"));
|
|
8
|
-
const useDepthLimit = (config) => {
|
|
1
|
+
import depthLimit from 'graphql-depth-limit';
|
|
2
|
+
export const useDepthLimit = (config) => {
|
|
9
3
|
const ignore = config.ignore || [];
|
|
10
|
-
const checkFn = (
|
|
4
|
+
const checkFn = depthLimit(config.maxDepth, { ignore });
|
|
11
5
|
return {
|
|
12
6
|
onValidate({ addValidationRule }) {
|
|
13
7
|
addValidationRule(checkFn);
|
|
14
8
|
},
|
|
15
9
|
};
|
|
16
10
|
};
|
|
17
|
-
exports.useDepthLimit = useDepthLimit;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/depth-limit",
|
|
3
|
-
"version": "1.6.0-alpha-
|
|
3
|
+
"version": "1.6.0-alpha-731c100.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.4.0-alpha-
|
|
6
|
+
"@envelop/core": "2.4.0-alpha-731c100.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|