0.13.0-alpha.eacbee5c • Published 6 years ago
graphql-code-webpack v0.13.0-alpha.eacbee5c
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'
}
]
}
};
0.13.0-alpha.fe7f3e8e
6 years ago
0.13.0-alpha.a6dc2cdf
6 years ago
0.13.0-alpha.e3b86daa
6 years ago
0.13.0-alpha.f8c8892a
6 years ago
0.13.0-alpha.eacbee5c
6 years ago