Adrinalin4ik / Nestjs-Graphql-Tools

NestJS Graphql Tools is a flexible solution that provides a bunch of decorators for solving problems like n+1 request, filtering, sorting, pagination, polymorphic relation, graphql field extraction. It is fully based on decorators. To use it you can just add a decorator to your resolver.
GNU General Public License v3.0
80 stars 8 forks source link

change Loader req destructuring to optional chain #44

Closed ssaifriend closed 3 weeks ago

ssaifriend commented 1 month ago

problem

When using GraphQL Subscription, req is not set, causing a destructuring error

Adrinalin4ik commented 3 weeks ago

@ssaifriend The problem is that it won't work with subscriptions. It uses req as a store for loader. If it doesn't exist then it will fail. I think there must me better solution that allows to customize where the loader should be stored.

ssaifriend commented 3 weeks ago

Ok. I'll think about it more. I'll reopen the PR when I'm ready.