0.0.7 • Published 3 years ago

graphql-codegen-webpack-plugin v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

GraphQL Code Generator webpack plugin

A webpack plugin for GraphQL Code Generator.

Getting started

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

Create a configuration file for GraphQL Code Generator:

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

Refer to the Config Reference when writing the configuration.

Finally, add the plugin to your webpack configuration:

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

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

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago