Custom error message
See original GitHub issueIs it possible to modify the error
object?
{
"data": null,
"errors": [
{
"message": "Insufficient Permissions.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"getSurveys"
]
}
]
}
Or can we directly use other error handler like apollo-errors instead of using the default “Insufficient permission”
Thanks for the assist!
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
How to Make a Fake Error Message in Windows - wikiHow
1. Open the Notepad app.
Press the ⊞ Win+R keys simultaneously.
Type notepad into the Run dialog.
Hit Enter or click OK. 2. Copy and paste...
Read more >Custom Error Messages - express-validator
Custom Error Messages ... express-validator's default error message is a simple Invalid value . That's enough to cover all fields without being too...
Read more >Providing custom error messages for built-in HTML5 form ...
How to customize built-in form validation error messages · Grab the input element(s) with a querySelector / querySelectorAll . · Add an event ......
Read more >Flutter Custom Error Message - Flash Message - YouTube
Flutter Shop UI Kit: https://cutt.ly/rFOscFoPackage: https://pub.dev/packages/awesome_snackbar_content▻ Source Code : ...
Read more >Return Custom Error Message for Any Issue in Power Query
Learn how to return custom error messages whenever any applied step in a Power Query query fails. More info about the m code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dakshshah96 Sure!
Example you have a “validation” resolver:
Resolver A:
validateAuthObject
In your main resolver of a certain GraphQL query, let say
getData(user: User, options: JSON!)
. We combine ourvalidateUserObject
and the “main” resolver.Once
user
isnull
it will return tAnother approach is without the need for an extra resolver (if there’s no need for reusability). Let’s use your code here as an example:
I hope this helps. 😃
@jhnferraris If it’s not too much trouble, can you give me an example of how custom errors can be implemented? I’ve already defined all of my schema using
graphql-tools
in myapollo-server
powered GraphQL backend. Thanks!