mutations
mutations copied to clipboard
Optionally raise on empty hash filter definitions
I've recently spent several hours debugging a problem that was caused by an empty hash definition
required do
hash :hash_name
end
Such definition discards any hash content being passed in, which is very confusing and I reckon rarely useful, but very unintuitive interface (found other 3 bugs in the codebase caused by the exact same problem).
This change makes such definitions raise, but only if Mutations.raise_on_empty_hash_filter is set to true (defualt false). Such optional raising avoids breaking change.
Overall, I recommend changing the interface to raise on bogus definition as a default, instead of the opt-in.