Updating invalid Enum fields

#1

I have a type with a field who’s enum value has been changed. The enums used to be:
status : string enum("Open", "Closed")
and they were changed to:
status : string enum("New", "Accepted", "Rejected", "System_Expired")

Ideally whoever made that change would have written a migration for the data but we wouldnt be here if that were the case. When I try to update the status field of the objects to the new enums I get this error from the mergeBatch API:

"Invalid value "Open" for field status in type InventoryRecommendation. Can only be one of [New, Accepted, Rejected, System_Expired].

Is there a way to circumvent this Typesystem checking?

0 Likes

#2

Data migration is best - but if that’s not an option then I add back old values and add comment regarding technical debt.

0 Likes