One, environment configuration
-
The official website provides two ways to operate
graphql
- Define the traditional way first
schema
- Directly use
typescript-graphql
the object method to create
- Define the traditional way first
-
2. Install dependency packages (developed by means of automatic generation by creating objects
schema
)npm install @nestjs/graphql graphql-tools graphql apollo-server-express
-
3.
app.module.ts
Add in the fileimport { Module } from '@nestjs/common'; import { AppControl