Renaming a Switch Option doesn't update DB

Issue Description: What’s happening?

When renaming a Switch option, running a query afterwards shows the old value is used. I found this by misspelling an option and then correcting it. This may not be a bug but feels dangerous and unexpected.

Reproduce the Issue: What steps can someone take to replicate the problem?

  1. Add a type Custom Switch field in a table with a couple options and save.
  2. Edit the first option so that it is a different value.
  3. Query against the table with that switch using API Explorer.

Expected Behavior: What did you expect to happen?

I expect the option string to be updated to the new value. I expect the String to a virtual key into the options, not an actual string.

Actual Behavior: What actually happened?

It retains the old value, in my case, “Stoty”. It looks like the value is independent from the options, which makes it very dangerous to change the options.

More details or screenshot

{
  estimatesList {
    items {
      type
      title
    }
  }
}

{
  "data": {
    "estimatesList": {
      "items": [
        {
          "type": "Stoty",
          "title": "2 – Small",
        },

image

Hey @mike_ekim1024 - this is something that we are aware of and need to correct.

In the meantime, I recommend using and “UpdateByFilter” to correct the wrong values.

mutation {
  estimatesUpdateByFilter(
    data: {
      type: {
        set: "Story"
      }
    },
    filter: {
      type: {
        equals: "Stoty"
      }
    }
  ) {
    count
  }
}

Thank you, Sebastian.