Graphene_Django: How to send error messages or custom data
Graphene_Django: How to send error messages or custom data
Using graphene-django and I can't figure out how to send a good error message to the client. Another option is how could I create custom messages to send back to the client.
For a situation where someone tries to create an account but the email address has already been registered I'd like to send back something like:
"data":
"error":
"statusText": "This email address is not available",
"statusCode": "401" // or whatever the status code is
Either option would be great, either some built in methods to send back an error or custom data. Any help is much appreciated.
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.