# @envelop/graphql-modules

Latest version **9.2.1** (published 2026-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @envelop/graphql-modules
pnpm add @envelop/graphql-modules
yarn add @envelop/graphql-modules
bun add @envelop/graphql-modules
```

## 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 | 9.2.1 |
| Published | 2026-09-16 |
| First published | 2021-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8529 |
| Author | Dotan Simha <dotansimha@gmail.com> |
| Maintainers | dotansimha, enisdenjo, theguild-bot |

## Links

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

## Dependencies (1)

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

## Recent versions

- 9.2.1 (latest) — 2026-09-16
- 10.0.0-alpha-20260420122826-afff629b648b45dc56cbf71f10a44eb4006be3c3 (alpha) — 2026-04-20
- 7.1.3-rc-20250306153119-ed3979491f3ac71caf439dd723f2d12d26b1000f (rc) — 2025-03-06
- 9.2.0 — 2026-08-19
- 9.1.1-alpha-20260211135637-93c20e8d6487b818cbaeae5d79720080f2cdb30f — 2026-02-11
- 9.1.1-alpha-20260211135549-d5b47440cdcf7b0c44848a5d2d061d5bd2270ca4 — 2026-02-11
- 9.1.1-alpha-20260211135457-17dcb4f75d8b14c54c5b72820d4adc64ee17a76b — 2026-02-11
- 9.1.1 — 2026-02-11
- 9.1.1-alpha-20260211134540-a42c1c0e06864232b43671a2c90543caf9e7a99a — 2026-02-11
- 9.1.1-alpha-20260211133743-c4aa2c6402a6830521632f3ae388267ba187aba3 — 2026-02-11
- 9.1.0 — 2026-01-20
- 9.1.0-alpha-20260120170745-adbe13e06b251f86813e84382d87a6113a9c11cf — 2026-01-20
- 9.1.0-alpha-20260120165659-e6c64c712e52f7da442c51fed7a2aa5436afed6c — 2026-01-20
- 9.1.0-alpha-20260120165332-6d6a496b7a518ed85a7ce7c43c610183dabe24ca — 2026-01-20
- 9.1.0-alpha-20260120164856-c20d9370e5c23c9e9add81795b0f6f9d39863860 — 2026-01-20
- … 2077 more at https://npm.io/package/@envelop/graphql-modules/versions

## README

## `@envelop/graphql-modules`

This plugins integrates [`graphql-modules`](https://github.com/Urigo/graphql-modules) execution
lifecycle into the GraphQL execution flow.

If you are using `graphql-modules` dependency injection - this setup is needed in order to make sure
`Injector` is created and destroyed at the right time.

## Getting Started

```
yarn add @envelop/graphql-modules
```

## Usage Example

```ts
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { createApplication } from 'graphql-modules'
import { envelop, useEngine } from '@envelop/core'
import { useGraphQLModules } from '@envelop/graphql-modules'

const myApp = createApplication({
  modules: [
    /* ... */
  ]
})

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    // ... other plugins ...
    useGraphQLModules(myApp)
  ]
})
```

Then, you can use GraphQL-Modules `injector` in your resolvers:

```ts
const resolvers = {
  Query: {
    foo: (root, args, context, info) => {
      const myProviderInstance = context.injector.get(/* ... */)
    }
  }
}
```

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