# @eddeee888/nx-graphql-code-generator

> The Nx Plugin to integrate graphql-code-generator with Nx projects

Latest version **2.1.0** (published 2026-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @eddeee888/nx-graphql-code-generator
pnpm add @eddeee888/nx-graphql-code-generator
yarn add @eddeee888/nx-graphql-code-generator
bun add @eddeee888/nx-graphql-code-generator
```

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2026-07-07 |
| First published | 2022-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 33.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2 |
| Author | Eddy Nguyen |
| Maintainers | eddeee888 |
| Keywords | nx, nx-plugin, monorepo, graphql-code-generator, graphql-codegen, codegen |

## Links

- npm: https://www.npmjs.com/package/@eddeee888/nx-graphql-code-generator
- Repository: https://github.com/eddeee888/nx-plugins
- Homepage: https://github.com/eddeee888/nx-plugins#readme
- Issues: https://github.com/eddeee888/nx-plugins/issues
- npm.io page: https://npm.io/package/@eddeee888/nx-graphql-code-generator

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.4.1
- [semver](https://npm.io/package/semver.md) ^7.5.4
- [@nx/devkit](https://npm.io/package/@nx/devkit.md) ^20.0.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

- 2.1.0 (latest) — 2026-07-07
- 0.0.0-pr149-run153-1-20260707102629 (alpha) — 2026-07-07
- 0.0.0-pr112-run62-1-20231228122341 (pr112-run62-1) — 2023-12-28
- 0.0.0-pr112-run61-1-20231228113846 (pr112-run61-1) — 2023-12-28
- 0.0.0-pr112-run60-1-20231228102811 (pr112-run60-1) — 2023-12-28
- 0.0.0-pr111-run58-1-20231226060859 (pr111-run58-1) — 2023-12-26
- 0.0.0-pr93-run41-1-20230416025828 (pr93-run41-1) — 2023-04-16
- 0.0.0-pr75-run16-1-20221219132350 (pr75-run16-1) — 2022-12-19
- 0.0.0-pr73-run14-1-20221127102110 (pr73-run14-1) — 2022-11-27
- 0.0.0-pr73-run13-1-20221127101322 (pr73-run13-1) — 2022-11-27
- 0.0.0-pr73-run12-1-20221127100749 (pr73-run12-1) — 2022-11-27
- 0.0.0-pr73-run11-1-20221127095330 (pr73-run11-1) — 2022-11-27
- 0.0.0-pr67-run5-1-20221127070613 (pr67-run5-1) — 2022-11-27
- 2.0.0 — 2025-01-04
- 1.1.0 — 2023-12-31
- … 18 more at https://npm.io/package/@eddeee888/nx-graphql-code-generator/versions

## README

# @eddeee888/nx-graphql-code-generator

This [Nx plugin](https://nx.dev/getting-started/intro) can be used to add [graphql-code-generator](https://www.graphql-code-generator.com/) config and packages to an Nx project.

## Generators

### add

You can use this generator to wire up codegen config to an Nx project.

```bash
$ nx generate @eddeee888/nx-graphql-code-generator --project=<existing project name>
```

| Options        | Required | Description                                                                                                                             |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `project`      | Yes      | Nx project to add codegen config to                                                                                                     |
| `schema`       | Yes      | Maps to codegen's [schema field](https://www.graphql-code-generator.com/docs/config-reference/schema-field)                             |
| `output`       | No       | Output path for the generated path. Relative from project root. More can be added manually later. Default: `graphql/generated.ts`       |
| `document`     | No       | Maps to codegen's [documents field](https://www.graphql-code-generator.com/docs/config-reference/documents-field)                       |
| `pluginPreset` | No       | Common [codegen plugins](https://www.graphql-code-generator.com/plugins) presets depending on project language, use cases and libraries |
| `config`       | No       | Name of codegen config file. Default: `graphql-codegen.ts`                                                                              |

## Executors

### codegen

You can use this executor to run codegen CLI. Note that the `add` generator automatically adds this to the project config. Your project config should look like this:

```js
// libs/<project name>/project.json
{
  // ...
  "targets": {
    // ...
    "graphql-codegen": {
      "executor": "@eddeee888/nx-graphql-code-generator:codegen",
      "options": {
        "configFile": "libs/<project name>/codegen.yml"
      }
    }
  }
}
```

You can run the executor like you woud other targets:

```bash
$ nx graphql-codegen <project name>
```

| Options      | Required | Description                                                                                                              |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `configFile` | Yes      | Path to the project's codegen config file                                                                                |
| `watch`      | No       | Run codegen in [watch mode](https://www.graphql-code-generator.com/docs/getting-started/development-workflow#watch-mode) |

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