Skip to content

Consider making futureProofEnums the default? #10878

Description

@martinbonnin

Is your feature request related to a problem? Please describe.

In order to write robust applications, it is important that application code handles unknown future values for enums.

Describe the solution you'd like

Making futureProofEnums the default would force consumers to handle unknown cases, making them more robust to schema evolutions.

The current value is named %future enum value but I would recommend __UNKNOWN instead which feels a little bit more inline with the usual GraphQL conventions.

Edit: never mind, __UNKNOWN is not what we want. but maybe %do not use this value, add a default case instead?

Relay has a linter rule to detect that all switches must also have a default: case

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions