This PR allows fields to have a graphql reflect tag in order to override the name of the field they resolve. This in turn would allow for field resolvers which are case-sensitive. Currently the library matches fields using case-insensitive matching and the _ char is insignificant. This violates the official GraphQL spec which states that names should be case-sensitive and the _ is significant.
With this change, similar to the json reflect tag, users can set a graphql tag in order to override the name. For example:
type resolver struct {
Hello string `graphql:"hello"`
}
or
type resolver struct {
Greeting string `graphql:"hello"`
}
The above would allow the users to override the name and use a case-sensitive matching. Both of the above resolvers would resolve a schema like this:
This PR allows fields to have a
graphql
reflect tag in order to override the name of the field they resolve. This in turn would allow for field resolvers which are case-sensitive. Currently the library matches fields using case-insensitive matching and the_
char is insignificant. This violates the official GraphQL spec which states that names should be case-sensitive and the_
is significant.With this change, similar to the
json
reflect tag, users can set agraphql
tag in order to override the name. For example:or
The above would allow the users to override the name and use a case-sensitive matching. Both of the above resolvers would resolve a schema like this:
fixes: #593