Currently, the type for mutation errors is just unknown. So whether you are awaiting a mutation or just accessing the error in onError, you must cast or narrow your error if its type is knowable.
This issue is to track adding an error typing functionality. I have picked this up formally, but feel free to discuss.
To avoid breaking changes, we are thinking of adding an inferError: boolean which would be false for all versions <=21. And then in 22, it would default to true.
Currently, the type for mutation errors is just
unknown. So whether you are awaiting a mutation or just accessing the error inonError, you must cast or narrow your error if its type is knowable.This issue is to track adding an error typing functionality. I have picked this up formally, but feel free to discuss.
To avoid breaking changes, we are thinking of adding an
inferError: booleanwhich would be false for all versions<=21. And then in 22, it would default totrue.