dotansimha/graphql-code-generator

[typescript] Opt out of suffix for enum value keys

開放

#6,499 建立於 2021年8月18日

 (2 則留言) (2 個反應) (0 位負責人)TypeScript (1,295 個分叉)batch import
corehelp wantedkind/enhancement

倉庫指標

星標
 (10,341 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Is your feature request related to a problem? Please describe. It's a bit odd that suffixes are applied to enum values in addition to the enum itself (when using typesSuffix):

export enum RoleSuffix {
  UserSuffix = 'USER',
  AdminSuffix = 'ADMIN'
}

Normally the suffix is useful to disambiguate the overall type when importing and using it in files, but there is not much benefit to having a suffix on the values themselves in most cases (UserSuffix, for example).

Describe the solution you'd like Add a flag to opt out of this behavior. suffixEnumValues true/false

貢獻者指南