Cannot catch GraphQL Errors
See original GitHub issueI’m submitting a…
[x] Bug report [x] Documentation issue or request
Current behavior
Using the example provided in the documentation, when defining a module that uses the graphqlExpress
middleware and using graphql-custom-types
I can’t catch any kind of errors of the type GraphQLError
. This means that cannot enforce or improve errors in this scenario.
Expected behavior
I can catch errors by type
Minimal reproduction of the problem with instructions
Following the GraphQL example and adding graphql-custom-types
packages. When for example instantiating UUID in a query, this dispatcher never reaches the code.
import { GraphQLError } from 'graphql/error';
@Catch(GraphQLError)
export class DispatchError implements ExceptionFilter {
public catch(err, res) {
console.log('NEVER REACHES THIS POINT')
}
}
What is the motivation / use case for changing the behavior?
Improve errors response depending Server needs.
Environment
Nest version: 4.6.6
For Tooling issues:
- Node version: 9.5.0
- Platform: Mac
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Handling operation errors - Apollo GraphQL Docs
Apollo Client can encounter a variety of errors when executing operations on your GraphQL server. Apollo Client helps you handle these errors according...
Read more >Handling GraphQL errors like a champ with unions and ...
Error handling can be frustrating in GraphQL. This post shows you how to use unions and interfaces to handle errors in a more...
Read more >GraphQL error handling to the max with Typescript, codegen ...
A GraphQL API will always return a 200 OK Status Code, even in case of error. You'll get a 5xx error in case...
Read more >A Guide to GraphQL Errors
With top-level errors this can't be done since the whole mutation ... Make them even better with error codes so clients can handle...
Read more >GraphQL Error Handling Best Practices for Security
The solution to catch these default errors before they get sent to the end-user is to use a custom formatError function in your...
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
@fjcero ,I still have this problem
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.