You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
The function unicode.IsLower returns true whenever the input rune is a lowercase letter, and returns false for anything else - including digits and special characters. As such, the "2" in "p2p" is treated as the start of a new word, splitting it into "p" and "2p", neither of which match the initialism "P2P".
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
In gqlgen.yml, include the following:
versions
go run github.com/99designs/gqlgen version
:v0.17.49
go version go1.22.1 linux/amd64
The text was updated successfully, but these errors were encountered: