-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add example of server-side validation failure #357
Comments
If you throw in mutateAndGetPayload, the errors will be sent to the browser. Come to think about it, this is rather inconvenient if we want to address those errors differently. |
@u9520107 transaction.getError() actually returns an error object. And it seems you can get an array of the individual errors from |
This is great discussion. Can we get this on Stack Overflow as a question, where it will endure long after this issue is closed? https://stackoverflow.com/questions/ask?tags=relayjs If you think there's something better Relay could be doing here, feel free to open a separate issue with a suggestion. |
@cesarandreu Would love a snippet or a more detailed example of handing server side validation. I see tons of examples of relay but none are geared towards real world scenarios. http://stackoverflow.com/questions/38706347/relay-mutation-with-serverside-validation |
Not sure if this belongs here or graphql-relay-js.
If you have validation that can only be done on the server, it's not clear how you can notify the client and how to handle it.
I asked about this in Reactiflux and someone pointed out I can throw in
mutateAndGetPayload
, and handle it in the onFailure callback of update.Having a small server-side failure example would be really helpful.
The text was updated successfully, but these errors were encountered: