graphql
graphql copied to clipboard
Support comparators for enums
Is your feature request related to a problem? Please describe. Many of our enums are ordered, e.g. lifecycleStage: PreProduction, Production, Deprecated, Decommissioned However these are not in alphabetical order so sorting by then ends up being meaningless.
Describe the solution you'd like support _LT, _LGT, _LTE, _GTE for enum fields which is aware of the order of the values in the enum's definition. This would also ideally support ordering of results by the order the enum is defined
Perhaps it could be turned on via a directive @ordered
as (particularly for ordering) the cypher code would not be able to rely on built in operators and would likely be less performant.
Describe alternatives you've considered
Fetching the data from the API and using other tools to order it accordingly
Using the _IN
filter with an exhaustive list of values that would be matched by the equivalent _LT etc. filter
Additional context Add any other context or screenshots about the feature request here.