mutations
mutations copied to clipboard
Add the "failure?" method to the outcome
The failure? method helps consumers of the mutations add some clarity.
Sometimes after a mutation, you really just want to recover gracefully on failure and I've found myself with plenty of code resembling the following:
mutation = SomeMutationClass.run(some_params)
unless mutation.success?
# do something to recover, like attempt something else
end
Having the failure?
method makes things just a little clearer since the code can now ask if failure?
.
Would be a nice addition, +1
It looks like the build failed on this primarily because the rbx
ruby target is not running properly.
This does look like it would be useful - sorry it sat unacknowledged for so long 😔
Would you be interested in rebasing this and resolving the conflicts so that I can merge it?