Is there a way to pass a provider into an imported library? I have the following module which which relies on a GraphQLSubgraphWrapperModule which is suppose to use the Module passed in the 3rd param in graphql module's include to restrict the resolvers to use to only the resolvers from this module. But the GraphqlModule ends up trying to instantiate the FileResolver and the FileService and doesn't have access to the providers of this module. And shouldn't really need it if the correct module was "instantiating" its own providers.
FileResolver has a single dependency on FileService and FileService has a single injection dependency on MINIO_PROVIDER
If more module signatures are needed then I can post them. I am assuming I am missing something simple here.
@Module({
imports: [],
providers: [MINIO_PROVIDER, FileService, FileResolver],
exports: [ FileService,FileResolver ],
})
export class NewRepoFileLibModule {
static forSubGraph(subGraphPath?: string): DynamicModule {
return {
module: NewRepoFileLibModule,
imports: [
DiscoveryModule,
GraphQLSubgraphWrapperModule.register(
'file',
schemaPath,
[NewRepoFileLibModule],
'fileSchemaProvider',
subGraphPath ? subGraphPath : '/graphql'
),
],
exports: [ FileService,FileResolver ],
};
}
}