As the enumeration values are statically typed (stored in the model config) we don’t have a method for fetching those values as it’s generally expected the frontend also would have them statically typed.
To fetch those you will either need to make a custom GraphQL resolve or a custom REST route/controller to fetch the data from the model information.
Hi @DMehaffy, I also have the same need and I do not agree with your first solution that we should store enum values on both frontend & backend, no one wants to maintain two lists for several reasons.
The second solution solves this issue but it would be nice to consider to add a convenient way to query enum values.
I was trying to find a solution to the same issue and found this “hacky” way to get enum values from Strapi, by making a GET request on the /content-type-builder/content-types/:uid endpoint which you’ll find in the Content-Type-Builder section of the User & Permissions Plugin
So you wrote a custom controller that returns strapi.models[ctx.query.model].allAttributes after checking to ensure that the user has queried an existing model and whether the user has the requisite permissions.
It creates a type definition file (on build or whenever you call it) directly from the schema which is pulled from strapis graphql endpoint, allowing you to iterate over the enum type in the frontend, without having you maintain multiple lists. I hope this helps.