dotansimha/graphql-code-generator

[experimental-graphql-modules] no config in generation for enums

Open

#5,242 创建于 2020年12月11日

在 GitHub 查看
 (4 评论) (1 反应) (0 负责人)TypeScript (1,295 fork)batch import
corehelp wantedkind/enhancementpresets

仓库指标

Star
 (10,341 star)
PR 合并指标
 (平均合并 46天 1小时) (30 天内合并 11 个 PR)

描述

Im using the new experimental graphql-module creation. In the old schema creation we had this config:

        config:
            constEnums: true
            avoidOptionals: true
            namingConvention:
                enumValues: change-case#upperCase

Now the new graphql-modules option creates the complete schema but i cant set any config. So i lost all my enums basically (which follow TS spec, also saw it with DTS generator). I can create the other as well, but why having two schemas :)

example new situation:

/** Order your items */
export type BasketListOrdering = 
  /** By department, which is based on product taxonomy */
  | 'DEPARTMENT'
  /** By latest item added first */
  | 'INPUT';

example old situation:

/** Order your items */
export const enum BasketListOrdering {
    /** By department, which is based on product taxonomy */
    DEPARTMENT = 'DEPARTMENT',
    /** By latest item added first */
    INPUT = 'INPUT',
}

btw really cool to see the progress on the suite!

贡献者指南