Before we continue and start using GraphQL, you should take a look at AppModule.
Open backend/src/app.module.ts. It should look as follows:
@Module({ imports: [ GraphQLModule.forRoot({ debug: true, playground: true, autoSchemaFile: 'schema.gql', }), // ... ], // ... } export class AppModule {}
If you've followed the Angular chapter (that is, Chapter 8, Discovering Angular, Angular Material, and RxJS), then this whole file should make you feel right at home. NestJS uses the same decorators/properties that we are now used to. In this case, we load GraphQLModule and configure it as required.
For this exercise, we have decided to follow the Code First approach, as proposed by the NestJS GraphQL plugin authors. This is the reason why we have defined the autoSchemaFile: 'schema.gql' option.
The GraphQL schema file will be generated automatically for us by the NestJS GraphQL plugin, thanks to the decorators that we have defined in the DTO as well as in the resolver.