XAuthorizer is marked as a scoped provider. Request and transient-scoped providers can't be used in combination with "get()" method. Please, use "resolve()" instead.
bug
**Describe the bug**
When you have 2 DTO `Parent` and `Child` and the `Child` has an authorizer, if the authorizer is request-scoped, it will produce this error when queried:
`XAuthorizer is marked as a scoped provider. Request and transient-scoped providers can't be used in combination with "get()" method. Please, use "resolve()" instead.`
### Have you read the [Contributing Guidelines](https://github.com/tripss/nestjs-query/blob/master/CONTRIBUTING.md)?
Yes
**To Reproduce**
I created a failing test in this commit: https://github.com/TriPSs/nestjs-query/commit/ffddb820178c8a0c9ee61ea1d89373c2336afeef
**Expected behavior**
I would expect it to work even if the Authorizer is request-scoped
**Additional context**
I think it may have been introduced by this change in nest(?): https://github.com/nestjs/nest/pull/15865
Would it be ok to change this line to use `await this.moduleRef.resolve(...)` instead of `.get()`? The parent function is already async so that shouldn't be a problem...
https://github.com/TriPSs/nestjs-query/blob/2bc913ada5ec62df54b7fca91a521adb31e51b9f/packages/query-graphql/src/auth/default-crud.authorizer.ts#L79
3 条评论