dotansimha/graphql-code-generator

[typescript] Opt out of suffix for enum value keys

Open

#6.499 geöffnet am 18. Aug. 2021

Auf GitHub ansehen
 (2 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)TypeScript (1.295 Forks)batch import
corehelp wantedkind/enhancement

Repository-Metriken

Stars
 (10.341 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 22T 9h) (53 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide