Support enum fields in conditional hydration - #723
Merged
mcaliskan2 merged 2 commits intoMay 4, 2026
Conversation
|
Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution. Already signed the CLA? To re-check, try refreshing the page. |
mcaliskan2
force-pushed
the
fix/enum-conditional-hydration
branch
from
April 28, 2026 08:25
7bb1aa4 to
e369c59
Compare
Collaborator
|
Looks good. Need to convert the |
gnawf
approved these changes
May 4, 2026
gnawf
left a comment
Collaborator
There was a problem hiding this comment.
Approved. I updated the .yml tests to the new NadelIntegrationTest
| val condition: NadelHydrationConditionDefinition, | ||
| ) | ||
|
|
||
| private sealed class NadelConditionFieldType { |
| ).asInterimSuccess() | ||
| } else if (expectedValue is String && conditionFieldType is NadelConditionFieldType.EnumType) { | ||
| if (conditionFieldType.enumType.getValue(expectedValue) == null) { | ||
| return NadelHydrationConditionInvalidEnumValueError( |
mcaliskan2
marked this pull request as ready for review
May 4, 2026 05:26
Contributor
Author
|
Thank you @gnawf 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Allow GraphQL
enumtypes as thesourceFieldin@hydrated(when: { result: { ... } })conditions, alongside the existingString/Int/IDscalars.What's in scope
equalspredicate accepts enum-typed condition fields. The supplied value must match a defined enum value (case-sensitive).startsWith/matchescontinue to requireString/ID— enums are rejected with the existing predicate-specific errors.NadelHydrationConditionInvalidEnumValueErrorraised whenequalsreferences a value not in the enum.NadelHydrationResultConditionUnsupportedFieldTypeErrormessage updated to mentionenumImplementation notes
NadelConditionFieldTypeintroduced so per-predicate type checks stay readable as more variants get added.Tests
startsWith+matchesrejection.@hydrated), and batched polymorphic