undefined root_level_errors? true
Hello, small problem here. I am doing something like this
where I return {: error, changeset} I want the errors to bubble up and be returned by the graphql layer but
root_level_errors?
seems to be undefined. right now when you enter an invalid email the error returned is a generic something went wrong.3 Replies
So, you should probably see something in the logs showing a stack trace. The basic problem here is that changes don’t return
{:error, changeset}
if you want to add an error use Ash.Changeset.add_error
. In your case however it looks like you just only want to run the after action hook if the changeset is valid, but that is already how it works (we don’t do the action on invalid changes)
So you should be able to just change the attribute and add the after action hook and return thatThe problem I have is that the error is not bubbling up to graphql and the web layer. instead I get a generic
something went wrong in my tests
when I expect the message to be an email being invalid message. How would you structure this in a way that the errors are sent back to the web layer when the changeset is invalid.You should be getting a log message explaining what the error was. Only errors that implement
AshGraphql.Error
are shown to the client for security reasons
And for things like a pattern match error, we definitely don’t want to show that over the api