mercurius-js / cache

Adds an in-process caching layer to Mercurius. Federation is fully supported.
MIT License
106 stars 19 forks source link

500 Internal Issue when Mercurius Cache is used with the NestJS Auth Guard #118

Closed sushilkjaiswar closed 1 year ago

sushilkjaiswar commented 1 year ago

Hi All,

Did anyone faced following issue while using Mercurius Cache with NestJS auth where it throws 500 Internal Issue.

Use Case: I have global auth applied in NestJS and when auth token becomes invalid or auth token is not provided then it throws 500 Internal Issue rather than correct exception which should be Forbidden or Authentication Required.

I tried skip property of Mercurius Cache which addressed one scenario where if Authorization token is passed in the http header then it works as intended but when token is not present in http headers it throws 500 instead of 403 Authentication not required.

Thanks

mcollina commented 1 year ago

Thanks for reporting. We do not have the resources to support Nest.js users. Please refer to the Nest Discord channel (support) for such questions.