ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.25k stars 744 forks source link

Providing an enum value naming convention makes introspection incompliant with the GraphQL specification #2610

Open Zero3 opened 3 years ago

Zero3 commented 3 years ago

When providing an INamingConventions implementation that overrides GetEnumValueName(object value), it is also applied to the introspection schema, making it incompliant with the GraphQL specification, at least as far as I can tell.

The default DefaultNamingConventions does value.ToString().ToUpperInvariant(), which gives correct enum names during introspection, like this field in an entry of __Type:

"kind": "OBJECT"

But making a CustomNamingConventions that does value.ToString(); instead, for example, then the introspection results become seemingly incompliant (see http://spec.graphql.org/June2018/#sec-Schema-Introspection)

"kind": "Object"

I've tested with various third party tools that use GraphQL introspection, and they return introspection errors when using the CustomNamingConventions in my example.

HotChocolate version: 10.5.3

Zero3 commented 2 years ago

Well... If my issues get automatically closed by stalebot like this, I will most likely stop contributing bug reports to this project. I already spent time creating the bug reports, so seeing it wasted by having them closed by a bot because they have not been fixed yet is super demotivating.