@envelop/depth-limit 1.6.0-alpha-26c4ae2.0 → 1.6.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/README.md +30 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/depth-limit",
|
|
3
|
-
"version": "1.6.0
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.4.0
|
|
6
|
+
"@envelop/core": "^2.4.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|