99designs / 99designs/gqlgen

Initialisms make some words codegen with weird capitalization

Abierto
#3,441 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
10.8k
Forks
1.3k
Merge medio
2 d 36 min
PR fusionados (30 d)
26

Descripción

### What happened?
if you declare an enum in your schema like
```
enum MessagingPlatform {
SLACK
}
```
the go type it codegens

```
type MessagingPlatform string

const (
MessagingPlatformSLACk MessagingPlatform = "SLACK"
)
```

I believe this is because Slack contains the initialism SLA so it's keeping the initialism capitalized and then capitalizing the first letter. Possible [relevant code file](https://github.com/99designs/gqlgen/blob/fbe0246f8c04793501996a76591ee3a43c5a9b43/codegen/templates/templates.go#L770)

### What did you expect?
I would expect a way to express that the SLA substring is not an initialism and have it look like `Slack`. What would you recommend to enable this?

### Minimal graphql.schema and models to reproduce
See above

### versions
- `gqlgen version` v0.17.57
- `go version` go version go1.23.4 darwin/arm64

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.