一、环境配置
-
1、官网地址
官网提供了两种方式来操作
graphql
- 传统的方式先定义
schema
- 直接使用
typescript-graphql
的对象方式来创建
- 传统的方式先定义
-
2、安装依赖包(采用创建对象的方式自动生成
schema
的方式开发)npm install @nestjs/graphql graphql-tools graphql apollo-server-express
-
3、在
app.module.ts
文件中添加import { Module } from '@nestjs/common'; import { AppControl