and as you can see, I want to log access to the entity, which has this defined:
@BeforeFindOne(ActivityLogAccessHook)
the module is configured as follows:
Module({
imports: [
NestjsQueryGraphQLModule.forFeature({
// import the NestjsQueryTypeOrmModule to register the entity with typeorm
// and provide a QueryService
imports: [
NestjsQueryTypeOrmModule.forFeature([Article]),
NestjsQueryTypeOrmModule.forFeature([ActivityLog]),
ActivityLogAccessHook,
ActivityLogModule,
],
// describe the resolvers you want to expose
assemblers: [ArticleAssembler],
resolvers: [
{
DTOClass: Article,
EntityClass: Article,
enableAggregate: true,
enableSubscriptions: true,
enableTotalCount: true,
},
],
}),
],
})
export class ArticleModule {}
and try as I might, I always get the following:
[Nest] 13964 - 2023-02-07, 3:47:55 p.m. ERROR [ExceptionHandler] Nest can't resolve dependencies of the ActivityLogAccessHook (?). Please make sure that the argument ActivityLogRepository at index [0] is available in the ActivityLogAccessHook context.
Potential solutions:
- If ActivityLogRepository is a provider, is it part of the current ActivityLogAccessHook?
- If ActivityLogRepository is exported from a separate @Module, is that module imported within ActivityLogAccessHook?
@Module({
imports: [ /* the Module containing ActivityLogRepository */ ]
})
and I've had the same issue whether I try to import a repository, query service, or any other injectable service. Any help would be appreciated.
try as I might, I have not been able to get dependency injection working for anything with my hook class.. Here is the class:
and as you can see, I want to log access to the entity, which has this defined:
@BeforeFindOne(ActivityLogAccessHook)
the module is configured as follows:
and try as I might, I always get the following:
and I've had the same issue whether I try to import a repository, query service, or any other injectable service. Any help would be appreciated.