When input params are passed to changesets from Phoenix Controllers, keys in the map are string keys.
When input params are passed to changesets from Absinthe, keys in the map are atom keys.
In one of my changesets (or in the context), I want to make a small adaptation to the map containing input values received in arguments, and need to add a key. But I will have the following error when casting:
** (Ecto.CastError) expected params to be a map with atoms or string keys, got a map with mixed keys
That’s because if I add the key as an atom, it will complain to be mixed with the map coming from the Controller; if I add the key as a string, it will in turn complain to be mixed with atom keys from Absinthe.
Any advice?