Skip to content

Commit a3b021f

Browse files
committed
feat: configured base graphql
1 parent 6b9d3d2 commit a3b021f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,4 @@ Temporary Items
396396
# Local
397397
.env
398398
dist
399+
**/schema.gql

src/app.module.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
import { join } from 'path';
12
import { Module } from '@nestjs/common';
23
import { ConfigModule } from '@nestjs/config';
3-
import { AppController } from './app.controller';
4+
import { GraphQLModule } from '@nestjs/graphql';
5+
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
46
import config from './config';
57

8+
import { AppController } from './app.controller';
9+
import { SampleModule } from './sample/sample.module';
610
@Module({
711
controllers: [AppController],
812
imports: [
913
ConfigModule.forRoot({ isGlobal: true, load: [config] }),
14+
GraphQLModule.forRoot<ApolloDriverConfig>({
15+
driver: ApolloDriver,
16+
autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
17+
debug: true,
18+
playground: true,
19+
}),
20+
SampleModule,
1021
],
1122
})
1223
export class AppModule {}

0 commit comments

Comments
 (0)