Number String or Int not allowed in Enum
When defining an enum with a Number String like "11201" or an Int like11201, it will result in a schema validation error Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "11201" does not.
Why are number strings or Int not allowed to be an enum? Thank you!
snippet:
enum IsoClass {
11201
11202
11203
}
- assignee(s): @acao
- source:
Note: Action Item issues are reviewed and closed during Working Group meetings.
https://github.com/graphql/graphiql/issues/586
I have been facing the same issue. Would greatly appreciate this as a feature.
Enum values conform to Name; some previous comments on requests like this:
- https://github.com/graphql/graphql-spec/issues/779#issuecomment-701891496
- https://github.com/graphql/graphql-spec/issues/508#issuecomment-426144240
I don't think this was actually a GraphQL Spec WG Action Item so I'm going to remove the label.
I think it's in-line with enum concept in programming languages like c# or java - enum is a list of names (!) or named int constants (in c#). I would better keep it this way, aligned with mainstream