unknownEnumValue property
Standard enum value for handling unknown enum values from the server.
This value is automatically added to all generated enums to provide forward compatibility when the GraphQL schema evolves and new enum values are added on the server side. The client can gracefully handle these unknown values instead of failing to deserialize.
Example usage in generated code:
enum UserRole {
ADMIN,
USER,
UNKNOWN, // This value
}
Implementation
static final EnumValueDefinition unknownEnumValue = EnumValueDefinition(
name: EnumValueName(name: 'UNKNOWN'),
);