@envelop/depth-limit 1.6.0-alpha-c0cc559.0 → 1.6.0-alpha-e9434aa.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/cjs/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDepthLimit = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_depth_limit_1 = tslib_1.__importDefault(require("graphql-depth-limit"));
6
+ const useDepthLimit = (config) => {
7
+ const ignore = config.ignore || [];
8
+ const checkFn = (0, graphql_depth_limit_1.default)(config.maxDepth, { ignore });
9
+ return {
10
+ onValidate({ addValidationRule }) {
11
+ addValidationRule(checkFn);
12
+ },
13
+ };
14
+ };
15
+ exports.useDepthLimit = useDepthLimit;
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
package/esm/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
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) => {
9
+ const ignore = config.ignore || [];
10
+ const checkFn = (0, graphql_depth_limit_1.default)(config.maxDepth, { ignore });
11
+ return {
12
+ onValidate({ addValidationRule }) {
13
+ addValidationRule(checkFn);
14
+ },
15
+ };
16
+ };
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-c0cc559.0",
3
+ "version": "1.6.0-alpha-e9434aa.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "2.4.0-alpha-c0cc559.0",
6
+ "@envelop/core": "2.4.0-alpha-e9434aa.0",
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
9
  "dependencies": {
@@ -11,26 +11,47 @@
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "https://github.com/dotansimha/envelop.git",
14
+ "url": "https://github.com/n1ru4l/envelop.git",
15
15
  "directory": "packages/plugins/depth-limit"
16
16
  },
17
17
  "author": "Dotan Simha <dotansimha@gmail.com>",
18
18
  "license": "MIT",
19
- "main": "index.js",
20
- "module": "index.mjs",
21
- "typings": "index.d.ts",
19
+ "main": "cjs/index.js",
20
+ "module": "esm/index.js",
21
+ "typings": "typings/index.d.ts",
22
22
  "typescript": {
23
- "definition": "index.d.ts"
23
+ "definition": "typings/index.d.ts"
24
24
  },
25
+ "type": "module",
25
26
  "exports": {
26
27
  ".": {
27
- "require": "./index.js",
28
- "import": "./index.mjs"
28
+ "require": {
29
+ "types": "./typings/index.d.ts",
30
+ "default": "./cjs/index.js"
31
+ },
32
+ "import": {
33
+ "types": "./typings/index.d.ts",
34
+ "default": "./esm/index.js"
35
+ },
36
+ "default": {
37
+ "types": "./typings/index.d.ts",
38
+ "default": "./esm/index.js"
39
+ }
29
40
  },
30
41
  "./*": {
31
- "require": "./*.js",
32
- "import": "./*.mjs"
42
+ "require": {
43
+ "types": "./typings/*.d.ts",
44
+ "default": "./cjs/*.js"
45
+ },
46
+ "import": {
47
+ "types": "./typings/*.d.ts",
48
+ "default": "./esm/*.js"
49
+ },
50
+ "default": {
51
+ "types": "./typings/*.d.ts",
52
+ "default": "./esm/*.js"
53
+ }
33
54
  },
34
55
  "./package.json": "./package.json"
35
56
  }
36
- }
57
+ }
File without changes
package/README.md DELETED
@@ -1,30 +0,0 @@
1
- ## `@envelop/depth-limit`
2
-
3
- This plugins uses [`graphql-depth-limit`](https://www.npmjs.com/package/graphql-depth-limit) in order to limit the depth of executed selection sets (by injecting a new GraphQL validation rule into your execution).
4
-
5
- ## Getting Started
6
-
7
- ```
8
- yarn add @envelop/depth-limit
9
- ```
10
-
11
- ## Usage Example
12
-
13
- ```ts
14
- import { envelop } from '@envelop/core';
15
- import { useDepthLimit } from '@envelop/depth-limit';
16
-
17
- const getEnveloped = envelop({
18
- plugins: [
19
- // ... other plugins ...
20
- useDepthLimit({
21
- maxDepth: 10,
22
- // ignore: [ ... ] - you can set this to ignore specific fields or types
23
- }),
24
- ],
25
- });
26
- ```
27
-
28
- ## Notes
29
-
30
- You can find more details here: https://www.npmjs.com/package/graphql-depth-limit#documentation
package/index.js DELETED
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
-
7
- const depthLimit = _interopDefault(require('graphql-depth-limit'));
8
-
9
- const useDepthLimit = (config) => {
10
- const ignore = config.ignore || [];
11
- const checkFn = depthLimit(config.maxDepth, { ignore });
12
- return {
13
- onValidate({ addValidationRule }) {
14
- addValidationRule(checkFn);
15
- },
16
- };
17
- };
18
-
19
- exports.useDepthLimit = useDepthLimit;
package/index.mjs DELETED
@@ -1,13 +0,0 @@
1
- import depthLimit from 'graphql-depth-limit';
2
-
3
- const useDepthLimit = (config) => {
4
- const ignore = config.ignore || [];
5
- const checkFn = depthLimit(config.maxDepth, { ignore });
6
- return {
7
- onValidate({ addValidationRule }) {
8
- addValidationRule(checkFn);
9
- },
10
- };
11
- };
12
-
13
- export { useDepthLimit };