Falsy values in select, radio fields #310
Replies: 3 comments 2 replies
-
Hey @tejasahluwalia, If you defined your collection as a I looked at widening the type to allow for an option: For your solution would you be able to have values/defaultValues of empty string: Feel free to share your field config if it aids in the discussion. |
Beta Was this translation helpful? Give feedback.
-
Hey @tejasahluwalia and @DanRibbens — One other consideration here is that GraphQL This may all likely be able to be worked around, but our API currently specifies select and radio option values as strings. Should we look into changing this further? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick replies guys. Just to clarify, I do get the TS error if I set the I don't know if this really needs a solution so to speak, it's not really a big issue because I can just set an option with, for example: |
Beta Was this translation helpful? Give feedback.
-
Hey guys, so for
select
andradio
fields, if there's a falsy value set as either thevalue
(in options) ordefaultValue
Payload throws an error:Collection -> Field -> "value" does not match allowed types
I feel like this could maybe be in the docs? What would be the best way to handle this? Because I didn't get any TS error so it was a little difficult to narrow down exactly what was happening. Also, I'm not sure what other fields this might apply to.
Beta Was this translation helpful? Give feedback.
All reactions