HasuraModule with forRootAsync is not working
See original GitHub issueWhen I import the HasuraModule with forRoot
it works
HasuraModule.forRoot(HasuraModule, {
secretFactory: 'myadminsecretkey',
secretHeader: 'x-hasura-admin-secret',
}),
But when I import the module with forRootAsync
it doesn’t work
HasuraModule.forRootAsync(HasuraModule, {
inject: [ConfigService],
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
secretFactory: configService.get<string>('GRAPHQL_API_AUTH_TOKEN'),
secretHeader: configService.get<string>('GRAPHQL_API_AUTH_HEADER'),
}),
}),
I think it’s something that I’m missing because no errors appears on the console just the RouteExplorer doesn’t map the routes.
Thanks for your support.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
TypeORM configuration works but not with ConfigService
One of two things needs to happen: 1) You need to make your ConfigModule global by passing the isGlobal: true option to ConfigModule....
Read more >joe-forked-golevelup-nestjs-hasura - npm package - Snyk
No known security issues ... The Hasura Module supports both the forRoot and forRootAsync patterns for configuration, so you can easily ...
Read more >@golevelup/nestjs-hasura - npm
Start using @golevelup/nestjs-hasura in your project by running `npm i ... The Hasura Module supports both the forRoot and forRootAsync ...
Read more >NestJS integrations for Working with Hasura - Morioh
The Hasura Module supports both the forRoot and forRootAsync patterns for configuration, so you can easily retrieve the necessary config values from a ......
Read more >MongoDB | NestJS - A progressive Node.js framework
With this, you can indicate whether a property is required or not, specify a ... Calling pre() or post() after compiling a model...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rigobcastro If you’re still interested in testing the new config service checkout https://github.com/golevelup/ts-ecosystem/tree/master/libs/profiguration
It provides a number of benefits over the NestJS Configuration module that’ll help you achieve 12factor:
get<string>(key)
because we already know it’s a string)Hey @rigobcastro thanks for reporting this. It should be fixed as of
@golevelup/nestjs-hasura@0.3.3