app.module.ts 691 字节
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { ConfigModule, ConfigService } from 'nestjs-config';
// import { AppController } from './app.controller';
// import { AppService } from './app.service';
import * as path from 'path';

@Module({
  imports: [
    ConfigModule.load(path.resolve(__dirname, 'config', '**/!(*.d).{ts,js}')),
    GraphQLModule.forRootAsync({
      imports: [ConfigModule],
      useFactory: (config: ConfigService) => config.get('graphql'),
      inject: [ConfigService],
    }),
  ],
  // controllers: [AppController],
  // providers: [AppService],
})
// export class AppModule {}
export class ApplicationModule {}