Skip to content

hyperse-io/graphql-codegen-enum

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
May 29, 2024
Apr 26, 2024
Apr 26, 2024
May 29, 2024
May 29, 2024
Apr 26, 2024
May 29, 2024
Jun 8, 2024
Apr 26, 2024
May 29, 2024
Jun 8, 2024
May 29, 2024
Apr 26, 2024
May 29, 2024
May 29, 2024
Apr 26, 2024
Apr 26, 2024
May 29, 2024
Apr 26, 2024
Apr 26, 2024
May 29, 2024
Apr 26, 2024
May 29, 2024
May 29, 2024
Sep 25, 2024
May 29, 2024
Apr 26, 2024
May 29, 2024
Apr 26, 2024
Sep 25, 2024

Repository files navigation

@hyperse/graphql-codegen-enum

build stable version GitHub top language Licence

Gernated by graphql-codegen only for scalar type enum

Usage

  1. yarn graphql @graphql-codegen/cli @graphql-codegen/add @hyperse/graphql-codegen-enum

  2. 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'],
  },
};
  1. Define codegen scripts
{
  "scripts": {
    "codegen": "graphql-codegen --config ./codegen.cjs"
  }
}
  1. 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.