Skip to content

Commit 0fb27ec

Browse files
committed
docs: clarify runtime behaviour for unmapped enum cases after future flip
The advisory deprecation already announces the opt-in migration. Add a second paragraph spelling out what happens if a resolver returns a case that lacks #[EnumValue] after the default flips: webonyx/graphql-php's native enum serialization rejects it, the same spec-compliant behaviour that applies to any unknown enum value. That is the mechanism that makes selective exposure safe — internal cases cannot leak via a resolver — and clarifies that omitting #[EnumValue] is a deliberate 'do not expose this value' signal, not an oversight to work around.
1 parent 3fe283f commit 0fb27ec

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

website/docs/descriptions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ flip so the migration path is mechanical: add `#[EnumValue]` to every case you w
148148
No runtime behaviour changes today — the notice only signals what the future default will
149149
require.
150150

151+
**Runtime implication after the flip.** Cases without `#[EnumValue]` will not exist in the
152+
GraphQL schema, so a resolver that returns such a case will trigger webonyx/graphql-php's
153+
standard enum serialization error (the value is not listed in the enum type's `values`
154+
config). This is the same spec-compliant behaviour that applies to any unknown enum value and
155+
is the mechanism that makes selective exposure safe: internal cases cannot accidentally leak
156+
via a resolver. Developers who want a case to remain returnable must keep `#[EnumValue]` on
157+
it; omitting the attribute is a deliberate "do not expose this value" signal.
158+
151159
## Description uniqueness on `#[ExtendType]`
152160

153161
A GraphQL type has exactly one description, so GraphQLite enforces that the description for a

0 commit comments

Comments
 (0)