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