99designs / 99designs/gqlgen

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

Đang mở
#3,170 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### 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`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.