mutations icon indicating copy to clipboard operation
mutations copied to clipboard

Optionally raise on empty hash filter definitions

Open mariokostelac opened this issue 4 years ago • 0 comments

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.

mariokostelac avatar Aug 05 '21 06:08 mariokostelac