0.0.4 • Published 3 years ago

@lfgroup/codegen-js-converter v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@lfgroup/codegen-js-converter

Micro (1.8 kB) graphql-codegen plugin, that converts enums from provided GraphQL server schema to a file with JS objects.

Example

Taking following gql schema, this plugin would generate code below. It is convinient to use generated result in a pre-compiled enviroment such as next.config.js

enum WowRole {
  Healer
  Damage
  Tank
}
const WowRole = {
  Healer: 'Healer',
  Damage: 'Damage',
  Tank: 'Tank'
};

Usage

In your YAML config file add a new generated file with this plugin as stated:

generates:
  src/generated/types.js:
    plugins:
      - '@lfgroup/codegen-js-converter'
0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago