32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
|
|
import { Module } from '@nestjs/common';
|
|
import { GraphQLModule } from '@nestjs/graphql';
|
|
|
|
import { ConfigService } from '../config/config.service';
|
|
import { SystemSettingsResolver } from './system-settings.resolver';
|
|
import { ConfigModule } from '../config/config.module';
|
|
import { SystemSettings } from '../domain/system-settings.types';
|
|
import { PersistenceModule } from '../persistence/persistence.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule,
|
|
PersistenceModule,
|
|
GraphQLModule.forRootAsync<ApolloDriverConfig>({
|
|
driver: ApolloDriver,
|
|
useFactory: async (configService: ConfigService) => ({
|
|
debug: await configService.get(SystemSettings.Graphql.Debug),
|
|
playground: await configService.get(SystemSettings.Graphql.PlaygroundEnabled),
|
|
introspection: await configService.get(SystemSettings.Graphql.IntrospectionEnabled),
|
|
typePaths: ['../graphql/**/*.graphql'],
|
|
}),
|
|
inject: [ConfigService],
|
|
imports: [ConfigModule],
|
|
})
|
|
],
|
|
providers: [
|
|
SystemSettingsResolver,
|
|
]
|
|
})
|
|
export class GraphqlServerModule {}
|