# @envelop/depth-limit

Latest version **8.0.0** (published 2026-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @envelop/depth-limit
pnpm add @envelop/depth-limit
yarn add @envelop/depth-limit
bun add @envelop/depth-limit
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.0.0 |
| Published | 2026-10-22 |
| First published | 2021-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.15.0 |
| Dependencies | 2 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8535 |
| Author | Dotan Simha <dotansimha@gmail.com> |
| Maintainers | dotansimha, enisdenjo, theguild-bot |

## Links

- npm: https://www.npmjs.com/package/@envelop/depth-limit
- Repository: https://github.com/graphql-hive/graphql-yoga
- Homepage: https://github.com/graphql-hive/graphql-yoga/tree/main/packages/envelop/plugins/depth-limit#readme
- npm.io page: https://npm.io/package/@envelop/depth-limit

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0
- [graphql-depth-limit](https://npm.io/package/graphql-depth-limit.md) ^1.1.0

## Recent versions

- 8.0.0 (latest) — 2026-10-22
- 8.0.0-rc-20261022165416-7c29decb398764e6ac3915e1c539c478cbf19237 (rc) — 2026-10-22
- 8.0.0-alpha-20261019231601-b21e6cedc1a444383d9ce69fe6180f5b4ff67120 (alpha) — 2026-10-19
- 8.0.0-alpha-20261019165905-4e993e96c2903cbe3084f9b49dfbf05042e3fe57 — 2026-10-19
- 8.0.0-alpha-20261019135505-9270088a653c3b9c07f54ef1cb67e69488e4e188 — 2026-10-19
- 8.0.0-alpha-20261009120802-464ace7b331b5693c49d18e270d79cb071e59247 — 2026-10-09
- 8.0.0-alpha-20261006205119-381bef34d7da2fde417073fec18c06eb58224f87 — 2026-10-06
- 8.0.0-alpha-20260929215310-f756e1d4981e8dd5ac5e128b5c2554893ae24a52 — 2026-09-29
- 7.2.1 — 2026-09-16
- 7.2.0 — 2026-08-19
- 8.0.0-alpha-20260420122826-afff629b648b45dc56cbf71f10a44eb4006be3c3 — 2026-04-20
- 7.1.1-alpha-20260211135637-93c20e8d6487b818cbaeae5d79720080f2cdb30f — 2026-02-11
- 7.1.1-alpha-20260211135549-d5b47440cdcf7b0c44848a5d2d061d5bd2270ca4 — 2026-02-11
- 7.1.1-alpha-20260211135457-17dcb4f75d8b14c54c5b72820d4adc64ee17a76b — 2026-02-11
- 7.1.1 — 2026-02-11
- … 1554 more at https://npm.io/package/@envelop/depth-limit/versions

## README

## `@envelop/depth-limit`

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).

## Getting Started

```
yarn add @envelop/depth-limit
```

## Usage Example

```ts
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine } from '@envelop/core'
import { useDepthLimit } from '@envelop/depth-limit'

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    // ... other plugins ...
    useDepthLimit({
      maxDepth: 10
      // ignore: [ ... ] - you can set this to ignore specific fields or types
    })
  ]
})
```

## Notes

You can find more details here: https://www.npmjs.com/package/graphql-depth-limit#documentation

---
_Source: https://npm.io/package/@envelop/depth-limit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
