# graphql-modules

> Create reusable, maintainable, testable and extendable GraphQL modules

Latest version **3.1.2** (published 2026-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-modules
pnpm add graphql-modules
yarn add graphql-modules
bun add graphql-modules
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.1.2 |
| Published | 2026-05-26 |
| First published | 2016-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 214.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1327 |
| Author | Kamil Kisiela |
| Maintainers | urigo, dotansimha, kamilkisiela, ardatan, enisdenjo, theguild-bot |
| Keywords | graphql, graphql-modules, server, typescript, the-guild |

## Links

- npm: https://www.npmjs.com/package/graphql-modules
- Repository: https://github.com/graphql-hive/graphql-modules
- Homepage: https://github.com/graphql-hive/graphql-modules#readme
- Issues: https://github.com/graphql-hive/graphql-modules/issues
- npm.io page: https://npm.io/package/graphql-modules

## Dependencies (4)

- [ramda](https://npm.io/package/ramda.md) ^0.32.0
- [@graphql-tools/wrap](https://npm.io/package/@graphql-tools/wrap.md) ^11.0.0
- [@graphql-tools/schema](https://npm.io/package/@graphql-tools/schema.md) ^10.0.0
- [@graphql-typed-document-node/core](https://npm.io/package/@graphql-typed-document-node/core.md) ^3.1.0

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 3.1.2 (latest) — 2026-05-26
- 3.2.0-alpha-20260712090108-c3446746cbb6fd1dfccad8a6b96eeaee85d2fa83 (alpha) — 2026-07-12
- 0.7.8-alpha-aeae92a.40 (canary) — 2019-07-20
- 3.1.2-alpha-20260526091739-d4a64c600ffe57ee73a7cd8fafe06965c4c98fe7 — 2026-05-26
- 3.1.2-alpha-20260526070141-bd5dfab15cc718486b0ff0541bb82c01ff4942fd — 2026-05-26
- 3.1.2-alpha-20260526063542-b30d1a923e319cb0738fd0db4aa3c71ccc369880 — 2026-05-26
- 3.1.2-alpha-20260525172406-80c80002c62d7e63b60d54c3fd1af29b694611c8 — 2026-05-25
- 3.1.2-alpha-20260525091447-5ef11746ede586d36efad107a47fb4e977ec177c — 2026-05-25
- 3.1.2-alpha-20260523170740-3bcbb3abb7da1658c00f19c9513764c4caba03f6 — 2026-05-23
- 3.1.2-alpha-20260523164813-42a520a571d24cede6cd908c78e07f136e2c89f2 — 2026-05-23
- 3.1.2-alpha-20260317220150-9a468825090253a16047e4cf7ba0a105749b9f22 — 2026-03-17
- 3.1.2-alpha-20260317205650-bb0946d19a1de73899b8cc5c3bb0806cbcccc92c — 2026-03-17
- 3.1.2-alpha-20260317205639-52448ab99613b20fea81e4b48159a7a43431360f — 2026-03-17
- 3.1.2-alpha-20260317012329-19b21b5966dfaf960c6614013e1989b39b91045c — 2026-03-17
- 3.1.2-alpha-20260316180329-c7e94547414009331dbe4847a351559595060db7 — 2026-03-16
- … 1197 more at https://npm.io/package/graphql-modules/versions

## README

[![modules](https://user-images.githubusercontent.com/25294569/64067074-ed185b80-cc2a-11e9-8f4d-5f1e19feaa0a.gif)](https://graphql-modules.com/)

[![npm version](https://badge.fury.io/js/graphql-modules.svg)](https://www.npmjs.com/package/graphql-modules)
![CI](https://github.com/graphql-hive/graphql-modules/workflows/CI/badge.svg)
[![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://the-guild.dev/discord)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)]()

**GraphQL Modules** is a toolset of libraries and guidelines dedicated to **create reusable, maintainable, testable and extendable modules** out of your GraphQL server.

- [Website](https://graphql-modules.com)
- [Documentation](https://graphql-modules.com/docs)

## Highlights

- **Reusable modules** - Modules are defined by their GraphQL schema (Schema first design). They can be shared between apps.
- **Scalable structure** - Manage multiple teams and features, multiple micro-services and servers.
- **Gradual growth** - A clear, gradual path from a very simple and fast, single-file modules, to scalable multi-file, multi-teams, multi-repo, multi-server modules.
- **Testable** - A rich toolset around testing, mocking and separation.

## Documentation

Documentation is available at [graphql-modules.com](https://graphql-modules.com/docs).

## Installation

To install graphql-modules, use the following:

```sh
$ npm install graphql-modules

# Or, with Yarn

$ yarn add graphql-modules
```

#### Pre-release

We are also publishing a pre-release version to NPM on each change.

Just take a look at the build status on Github Actions and find "Publish Canary" job to get the published version.

## Usage

More advanced usage at [graphql-modules.com](https://graphql-modules.com/docs)

```js
import { createModule, createApplication, gql } from 'graphql-modules'

const module = createModule({
  id: 'my-module',
  typeDefs: gql`
    type Post {
      id: ID
      title: String
      author: User
    }

    type Query {
      posts: [Post]
    }
  `,
  resolvers: blogResolvers
})

const application = createApplication({
  modules: [module]
})
```

Inside the `examples` directory you can find the following examples:

- [Simple GraphQL-Modules example](./examples/basic)
- [Using dependency injection in GraphQL Modules](./examples/basic-with-dependency-injection)

## Contributions

Contributions, issues and feature requests are very welcome. If you are using this package and fixed a bug for yourself, please consider submitting a PR!

And if this is your first time contributing to this project, please do read our [Contributor Workflow Guide](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md) before you get started off.

### Code of Conduct

Help us keep GraphQL Modules open and inclusive. Please read and follow our [Code of Conduct](https://github.com/the-guild-org/Stack/blob/master/CODE_OF_CONDUCT.md) as adopted from [Contributor Covenant](https://www.contributor-covenant.org/)

### License

[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/apollostack/apollo-ios/master/LICENSE)

MIT

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