graphql setup

This commit is contained in:
João Geonizeli
2022-08-15 07:08:51 -03:00
parent 0e27984e8e
commit 458d9a1376
10 changed files with 585 additions and 64 deletions

View File

@@ -1,10 +1,17 @@
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { GraphQLModule } from '@nestjs/graphql';
import { join } from 'path';
import { ThingResolver } from './thing/thing.resolver';
@Module({
imports: [],
controllers: [AppController],
providers: [AppService],
imports: [
GraphQLModule.forRoot<ApolloDriverConfig>({
driver: ApolloDriver,
autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
debug: true,
}),
],
providers: [ThingResolver],
})
export class AppModule {}