graphql-code-webpack
Integrates GraphQL Code Generator with Webpack
Last updated a year ago by dotansimha .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install graphql-code-webpack 
SYNC missed versions from official npm registry.

graphql-codegen-webpack

Integrates GraphQL Code Generator with Webpack

const { GraphQLCodegenPlugin } = require('graphql-codegen-webpack');

new GraphQLCodegenPlugin({
  schema: 'src/schema.graphql',
  template: 'graphql-codegen-typescript-template',
  out: 'src/types.ts',
  overwrite: true
});

Full example of webpack configuration:

const { GraphQLCodegenPlugin } = require('graphql-codegen-webpack');

module.exports = {
  mode: 'development',
  devtool: 'inline-source-map',
  entry: './src/index.ts',
  output: {
    filename: 'bundle.js'
  },
  resolve: {
    extensions: ['.ts', '.ts', '.js', '.mjs']
  },
  plugins: [
    // GraphQL Code Generator
    new GraphQLCodegenPlugin({
      schema: 'src/schema.graphql',
      template: 'graphql-codegen-typescript-template',
      out: 'src/types.ts',
      overwrite: true
    })
  ],
  module: {
    rules: [
      { test: /\.ts$/, loader: 'ts-loader' },
      {
        test: /\.mjs$/,
        include: /node_modules/,
        type: 'javascript/auto'
      }
    ]
  }
};

Current Tags

  • 0.13.0-alpha.fe7f3e8e                                ...           canary (a year ago)
  • 0.13.0-alpha.eacbee5c                                ...           latest (a year ago)

5 Versions

  • 0.13.0-alpha.fe7f3e8e                                ...           a year ago
  • 0.13.0-alpha.a6dc2cdf                                ...           a year ago
  • 0.13.0-alpha.e3b86daa                                ...           a year ago
  • 0.13.0-alpha.f8c8892a                                ...           a year ago
  • 0.13.0-alpha.eacbee5c                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |