fix(graphile-settings): uppercase enum values to match v4 CONSTANT_CASE convention #702
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(graphile-settings): uppercase enum values to match v4 CONSTANT_CASE
Summary
Adds an
enumValueinflector override to the existingInflektPluginingraphile-settingsto restore PostGraphile v4's behavior of uppercasing PostgreSQL enum values in the GraphQL schema.In PostGraphile v5, the default
enumValueinflector inPgCodecsPluginpreserves the original PostgreSQL casing (viacoerceToGraphQLName(value)). This means custom enum values likeapp,core,moduleappear lowercase in GraphQL instead ofAPP,CORE,MODULEas they did in v4.The fix delegates to the previous inflector (to retain all special character/symbol handling) and then applies
.toUpperCase()to the result.Review & Testing Checklist for Human
.toUpperCase()and not a more nuanced CONSTANT_CASE transform (e.g.,myValue→MYVALUEvsMY_VALUE). If your Postgres enums use camelCase or mixed-case values, the output may differ from expectations.ID_ASC, filter enums, etc.). These should already be uppercase so.toUpperCase()should be a no-op, but worth spot-checking.Notes