opened 02:47PM - 15 Sep 20 UTC
type: enhancement
severity: low
source: core:framework
source: plugin:graphql
## **Describe the bug**
This is a tracking issue for all the various referenc…es to the limitations of the enumeration field. All other issues, feature requests, and discussions will be closed and redirected here.
## **Context**
Currently within Strapi, the enumeration field is a literal usage of the definition of `enumeration` data type defined [here](https://en.wikipedia.org/wiki/Enumerated_type) in which generally speaking a `boolean` data type is also considered an enumeration type with the value options of `true` and `false`.
For Strapi, due to us supporting GraphQL, we have restricted the types of values that can be used based on the following regex **provided by Facebook, whom built GraphQL**:
> Name :: /[_A-Za-z][_0-9A-Za-z]*/
> GraphQL query documents are full of named things: operations, fields, arguments, directives, fragments, and variables. All names must follow the same grammatical form. Names in GraphQL are case‐sensitive. That is to say name, Name, and NAME all refer to different names. Underscores are significant, which means other_name and othername are two different names. Names in GraphQL are limited to this ASCII subset of possible characters to support interoperation with as many other systems as possible.
http://facebook.github.io/graphql/#sec-Names
## **Current behavior**
Using the above provided regex `/[_A-Za-z][_0-9A-Za-z]*/` values for enums are limited to:
- Must start with a letter, lower or upper **OR** and underscore `_`
- May have an infinite sane length
- May only contain upper or lowercase letters, numbers, and underscores
## **Expected behavior**
Requests from users (though not limited to, this will be updated over time)
- Spaces
- Dashes `-`
- Special characters for different languages
- Alternative symbols
Currently none of the above are allowed, and manually setting them via the model settings *may work* if you don't have the GraphQL plugin installed, **but are not supported** and you do so at your own risk until we find a valid replacement.
## **Related Issues, Feature requests, Discussions, and Forum threads**
Please note, the below are not the limit and additional entries may be linked to this issue, you can find them referenced in the comments.
- Original Discussion (very long): https://github.com/strapi/strapi/discussions/4780
- https://github.com/graphql/graphql-js/issues/936#issuecomment-349887156
- https://github.com/strapi/strapi/issues/4250
- https://github.com/strapi/strapi/issues/3921
- https://github.com/strapi/strapi/issues/3340
- https://github.com/strapi/strapi/issues/2494
- https://github.com/strapi/strapi/issues/1698
- https://github.com/strapi/strapi/discussions/7208
- https://github.com/strapi/strapi/issues/7896
- https://github.com/strapi/strapi/issues/7873
- https://github.com/strapi/strapi/issues/7600
- https://github.com/strapi/strapi/issues/7234
- https://github.com/strapi/strapi/issues/6328
- https://github.com/strapi/strapi/issues/5343
More will be shown below
## **Possible workarounds depending on the use case**
- Using relations such as `oneWay` with a storage model for the values (single select)
- Using relations such as `manyWay` with a storage model for the values (multi select)
- Use a standard enum that fits the regex and map these values out on your frontend (what is currently expected)
### To be very clear, we have no ETA on this, please do not reply asking for one.