# graphql-codegen-webpack-plugin

> A webpack plugin for [GraphQL Code Generator](https://www.graphql-code-generator.com/).

Latest version **0.0.7** (published 2021-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-codegen-webpack-plugin
pnpm add graphql-codegen-webpack-plugin
yarn add graphql-codegen-webpack-plugin
bun add graphql-codegen-webpack-plugin
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2021-05-31 |
| First published | 2021-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Artem Zakharchenko |
| Maintainers | kettanaito |

## Links

- npm: https://www.npmjs.com/package/graphql-codegen-webpack-plugin
- npm.io page: https://npm.io/package/graphql-codegen-webpack-plugin

## Recent versions

- 0.0.7 (latest) — 2021-05-31
- 0.0.6 — 2021-05-31
- 0.0.5 — 2021-05-31
- 0.0.4 — 2021-05-31
- 0.0.3 — 2021-05-31
- 0.0.2 — 2021-05-31
- 0.0.1 — 2021-05-31

## README

# GraphQL Code Generator webpack plugin

A webpack plugin for [GraphQL Code Generator](https://www.graphql-code-generator.com/).

## Getting started

```sh
npm install graphql-codegen-webpack-plugin
# or
yarn add graphql-codegen-webpack-plugin
```

Create a configuration file for GraphQL Code Generator:

```yml
# codegen.yml
schema: 'path/to/schema/**/*.gql'
documents: 'path/to/documents/**/*.tsx'
generates:
  schema.ts:
    plugins:
      - typescript
```

> Refer to the [Config Reference](https://www.graphql-code-generator.com/docs/getting-started/codegen-config) when writing the configuration.

Finally, add the plugin to your webpack configuration:

```js
// webpack.config.js
const {
  GraphQLCodegenWebpackPlugin,
} = require('graphql-codegen-webpack-plugin')

module.exports = {
  plugins: [
    new GraphQLCodegenWebpackPlugin({
      configPath: './graphql-codegen.yml',
    }),
  ],
}
```

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