Open bynov opened 1 year ago
I think is from a feature provided by a newer version of gqlgen. This bit is in the most recent version of the configuration docs page:
# Optional: set to modify the initialisms regarded for Go names
# go_initialisms:
# replace_defaults: false # if true, the default initialisms will get dropped in favor of the new ones instead of being added
# initialisms: # List of initialisms to for Go names
# - 'CC'
# - 'BCC'
"SLA"
is one of the initialisms it tries to leave capitalized (see here).
You could replace the defaults with your own set to avoid this.
@jskrzypek
enum LeadPracticeType {
SPEECH_LANGUAGE_PATHOLOGY
}
Generates:
type LeadPracticeType string
const (
LeadPracticeTypeSpeechLANGuagePathology LeadPracticeType = "SPEECH_LANGUAGE_PATHOLOGY"
)
If we specify following config:
go_initialisms:
replace_defaults: false
initialisms: # List of initialisms to for Go names
- 'LAN'
Is there a way to avoid to fix this?
@mwajeeh I'm sorry, I'm not an owner/maintainer of this library, so I don't know the answer. I imagine you can find out if you dig through the source code for gqlgen, e.g. do a code search for "initialisms" because something has to read the yaml file into go. Or just look at the repo details and tag one of the maintainers.
What happened?
I tried to generate enum, but one value after generation seems non-convenient :)
Interesting that it only occurred with
SLACK
value. I've used bunch of other names and it's fine. I've did several tests and seems like problem inSLA
inside ofSLACK
. It processes it like abbreviation :)What did you expect?
I'm expecting
PlatformIDSlack
instead ofPlatformIDSLACk
.Minimal graphql.schema and models to reproduce
Schema:
Generated models:
gclgen.yml:
versions
go run github.com/99designs/gqlgen version v0.17.22
go version go1.19.4 darwin/amd64