nestjs 一个nodejs 的graphql 框架node
npm i -g @nestjs/cli
nest new dalong
使用yarngit
yarn start
参考官方demo sample/12-graphql-apollogithub
- 运行
yarn && yarn start
代码比较简单,写过angular 的基本均可以看懂,主要是依赖注入,服务定义,以及graphql schema 定义,graphql resovler 编写 同时代码包含了一个subscription 的功能(基于ws 包, graphql 的实现基于apollo 以及express 代码仍是很清晰的。
https://docs.nestjs.com/
https://github.com/nestjs/nest/tree/master/sampleexpress