Skip to content

Conversation

@pyramation
Copy link
Contributor

fix(graphile-settings): uppercase enum values to match v4 CONSTANT_CASE

Summary

Adds an enumValue inflector override to the existing InflektPlugin in graphile-settings to restore PostGraphile v4's behavior of uppercasing PostgreSQL enum values in the GraphQL schema.

In PostGraphile v5, the default enumValue inflector in PgCodecsPlugin preserves the original PostgreSQL casing (via coerceToGraphQLName(value)). This means custom enum values like app, core, module appear lowercase in GraphQL instead of APP, CORE, MODULE as 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

  • Verify this matches v4 behavior: Confirm that v4 used simple .toUpperCase() and not a more nuanced CONSTANT_CASE transform (e.g., myValueMYVALUE vs MY_VALUE). If your Postgres enums use camelCase or mixed-case values, the output may differ from expectations.
  • Check impact on non-custom enums: This affects all enum values in the schema (OrderBy enums like ID_ASC, filter enums, etc.). These should already be uppercase so .toUpperCase() should be a no-op, but worth spot-checking.
  • Test with a running schema: Spin up a PostGraphile server with custom enum types and verify the GraphQL schema shows uppercase values. The build passes but there are no unit/integration tests covering this inflector.

Notes

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@Zetazzz Zetazzz merged commit 871f901 into develop-v5 Feb 12, 2026
13 checks passed
@Zetazzz Zetazzz deleted the devin/1770797722-uppercase-enum-values branch February 12, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants