-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Still allow generic Errors in redwood forms #3946
Conversation
I'm getting the same cypress e2e error on my PR as you're getting here. I've been trying to figure out why, but no luck yet :( |
@Tobbe See my comment here: #3772 (comment). |
The tests all pass now with the new version of cross-undici-fetch ✅ As far as this PR goes I like it 👍 @dthyresson You have also looked at the gql error stuff before. What's your take? |
Thanks @orta for this PR. FYI @dac09 and I recently spoke to the Guild about different approaches to error handling -- as the client side relies a little too much on Apollo's way of using error codes and having errors outside the data block. Instead, they promote a way of including errors as part of the SDL and using union types so that error message and info comes back as part of the data. See: https://blog.logrocket.com/handling-graphql-errors-like-a-champ-with-unions-and-interfaces/ But, we'll revisit this concept in V2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @orta
Yeah, I'm an "Errors in unions" person myself - https://artsy.github.io/blog/2018/10/19/where-art-thou-my-error/ |
The form error property accepts
any
:But raises an exception if it doesn't conform to
RWGqlError
which is an internal type. The form does a validation check for the other possible propertynetworkError
(via the null check) but doesn't forgraphQLErrors
. This was the minimal case change, but I think a tighter change might be making:to