Code Monkey home page Code Monkey logo

Comments (9)

chasevida avatar chasevida commented on July 27, 2024 5

@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 BaseExceptionFilter integration is a little bit more nuanced and I haven't sorted out how this may work together so I've removed that in the case of a GraphQL request which may not be ideal depending on the rest of your setup.

Happy to turn this into a PR if there's any guidance on what else should be considered here.

from nestjs-prom.

spike008t avatar spike008t commented on July 27, 2024 1

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.

from nestjs-prom.

roderik avatar roderik commented on July 27, 2024 1

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.

"@digikare/nestjs-prom": "roderik/nestjs-prom#master",

YMMV...

from nestjs-prom.

micolator avatar micolator commented on July 27, 2024

I use v1.0.0
Thanks for your feed back, and great work !

from nestjs-prom.

lukasender avatar lukasender commented on July 27, 2024

Is there a workaround for this? I'm getting the same error.

Thanks for your help in advance!
Great work! I'd love to keep using nestjs-prom! :)

from nestjs-prom.

kodeine avatar kodeine commented on July 27, 2024

Any updates on this?

from nestjs-prom.

kodeine avatar kodeine commented on July 27, 2024

@chasevida can you please submit PR for this

from nestjs-prom.

issackr avatar issackr commented on July 27, 2024

+1

from nestjs-prom.

chasevida avatar chasevida commented on July 27, 2024

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 BaseExceptionFilter works and check the integration for that is compatible. Currently, I've removed it for GQL requests which is quite an opinionated decision that may or may not suit you - I need to check more on this.

from nestjs-prom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.