@hyperse/graphql-codegen-enum
v1.0.3
Published
<p align="left"> <a aria-label="Build" href="https://github.com/hyperse-io/graphql-codegen-enum/actions?query=workflow%3ACI"> <img alt="build" src="https://img.shields.io/github/actions/workflow/status/hyperse-io/graphql-codegen-enum/ci-integrity.ym
Downloads
1
Readme
@hyperse/graphql-codegen-enum
Usage
yarn graphql @graphql-codegen/cli @graphql-codegen/add @hyperse/graphql-codegen-enum
setup codegen plugin on
codegen.cjs
module.exports = {
overwrite: true,
config: {
strict: true,
},
generates: {
'src/generated-types.ts': {
schema: 'http://localhost:7001/admin-api',
plugins: [
{
add: {
content: '/* eslint-disable */',
},
},
'@hyperse/graphql-codegen-enum',
],
},
},
hooks: {
afterAllFileWrite: ['prettier --write'],
},
};
- Define codegen
scripts
{
"scripts": {
"codegen": "graphql-codegen --config ./codegen.cjs"
}
}
yarn codegen
Note
This plugin normally used to gql.tada
, it will forcely only generated all enum
object, we assume that you don't need any other codegen typings except enum.