question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resolver class fails to register with provider wrapper that specifies useFactory

See original GitHub issue

I’m submitting a…


[ ] Regression 
[x] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When including a class decorated with @Resolver() via a FactoryProvider, it is not registered with the Nest.js GraphQL module

Expected behavior

Expected that useFactory would work the same way as passing the resolver class directly into the providers array. Selected documentation issue / request as unsure if this approach is supported or not. docs for reference

Minimal reproduction of the problem with instructions

Minimal reproduction - steps in README

Environment


Nest version: 8.0.6
Tested in 7.x.x too - same behaviour
 
For Tooling issues:
- Node version: 12.16.2
- Platform:  Linux

Others:
    "@apollo/gateway": "^0.38.0",
    "@nestjs/common": "^8.0.6",
    "@nestjs/core": "^8.0.6",
    "@nestjs/graphql": "^8.0.2",
    "graphql": "^15.5.1",
    "reflect-metadata": "^0.1.13",

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilmysliwieccommented, Sep 27, 2021
1reaction
kamilmysliwieccommented, Aug 26, 2021

Would you like to create a PR for this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom providers | NestJS - A progressive Node.js framework
First, we define a provider. The @Injectable() decorator marks the CatsService class as a provider. cats.service.ts. JS ...
Read more >
angular - Testing - Can't resolve all parameters for (ClassName)
I created an ApiService class to be able to handle our custom API queries, while using our own serializer + other features. ApiService...
Read more >
Dependency injection in action - Angular
Angular throws an error if it can't find the dependency during that walk. ... is a constructor parameter used to specify a custom...
Read more >
A Practical Guide to Providers in Angular - DEV Community ‍ ‍
Angular's Dependency Injection system. When you use the Angular CLI to generate a service, it automatically adds the code to register the ...
Read more >
Getting started with continuous integration for Nest.js APIs
I will wrap up the tutorial by showing you how to automate the testing process ... providers: [AppService], }) export class AppModule {}....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found