Skip to content

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

@Zero3

Description

@Zero3

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions