99designs / 99designs/gqlgen

Initialisms with digits in the middle of them aren't recognized

未关闭
#3,170 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
10.8k
派生
1.3k
平均合并
2 天 36 分钟
30 天内合并 PR
26

描述

### What happened?

In an application, there's a certain query type called "p2p". During generation, the function name for the query resolver gets converted to pascal case and becomes "P2p" which is undesirable. So I declared the initialism "P2P" in `gqlgen.yml` to fix this issue, but the initialism seems to be ignored and the expected resolver field name is still "P2p".

### What did you expect?

I expected the "P2P" initialism to be applied to the "p2p" query type upon capitalization, yielding the resolver name "P2P", not "P2p".

### Minimal graphql.schema and models to reproduce
```graphql
type P2PModel {
id: ID!
text: String!
}

type Query {
p2p(id: ID!): P2PModel!
}

input NewP2P {
text: String!
}

type Mutation {
create_p2p(input: NewP2P!): P2PModel!
}
```

In **gqlgen.yml**, include the following:
```yaml
go_initialisms:
initialisms:
- "P2P"
```

### versions
- `go run github.com/99designs/gqlgen version`: `v0.17.49`
- `go version go1.22.1 linux/amd64`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。