Raise an error of a lowercase value is used for a GraphQL Enum
requested to merge ld-raise-when-passed-lowercase-enum-value into ld-deprecate-lowercase-enums-values
What does this MR do?
Our GraphQL styleguide for enums says the values should be uppercase.
Previously a number of enums have been defined with lowercase values (!41635 (closed)).
This MR changes the BaseEnum.value
method to validate that the value passed to it does not contain a lowercase string.
It's hard to enforce this through something like Rubocop, as we often define enum values dynamically.
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Luke Duncalfe