-
Notifications
You must be signed in to change notification settings - Fork 54
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
PromCatchAllExceptionsFilter not compatible with GraphQL request #47
Comments
On which version are you using? Yes that's right, my module is only for http at the moment. I'll try to make it works with gql. |
I use v1.0.0 |
Is there a workaround for this? I'm getting the same error. Thanks for your help in advance! |
@lukasender I haven't completed a full integration with this module but I made some changes you can see here (https://github.com/chasevida/nestjs-prom/blob/feat/graphql/lib/prom-catch-all.exception-filter.ts) that enable integration with GraphQL. Essentially, you have to check for the context and switch appropriately - in this case to a GQL Context. However, there may be some issues depending on how you setup you Nestjs GraphQL module. Also the Nestjs Happy to turn this into a PR if there's any guidance on what else should be considered here. |
Any updates on this? |
@chasevida can you please submit PR for this |
+1 |
This is the code by @chasevida from digikare#47
I needed it as well since it is swallowing up the real errors underneath, so i made a fork, did the code change by @chasevida, upgraded all dependencies to their latest version (most notably nestjs to v8) and committed the build artefacts. You can use it like this until this change is integrated in the main repo.
YMMV... |
Hi @kodeine, unfortunately I haven't had the time to come back around to this. I think @roderik may have a more up to date workaround. There's still a few things I would need to finalise and get direction on before I think this would be PR worthy. Specifically I need to come back and look at how |
A gql request with an exception give this exception :
TypeError: Cannot read property 'baseUrl' of undefined", " at PromCatchAllExceptionsFilter.catch
Some info to use gql context :
https://docs.nestjs.com/graphql/other-features#exception-filters
https://docs.nestjs.com/fundamentals/execution-context#current-application-context
The text was updated successfully, but these errors were encountered: