Projen project type for GraphQL Code Generator.
const projen = new ProjenGraphQLCodegenProject({
// ... required projen options
// projen-graphql-codegen options
schema: 'my-schema.graphql',
eslintGraphQLConfig: 'schema-recommended',
generators: {
'./src/types.ts': {
plugins: ['typescript'],
config: {
avoidOptionals: true,
},
},
},
});
// add more generators later
projen.addGenerator('./src/foo.ts', {
plugins: ['typescript'],
})
// finally synth the project
projen.synth()
Then:
## build (codegen) your schema
projen build
## build & watch
projen watch