nestjs 一個nodejs 的graphql 框架
安裝
npm i -g @nestjs/cli
初始化項目
nest new dalong
運行demo
使用yarn
yarn start

添加graphql支持
參考官方demo sample/12-graphql-apollo
- 運行
yarn && yarn start
- 效果

- 操作
添加
查詢

源碼結構說明
代碼比較簡單,寫過angular 的基本都可以看懂,主要是依賴注入,服務定義,以及graphql schema 定義,graphql resovler 編寫
同時代碼包含了一個subscription 的功能(基於ws 包, graphql 的實現基於apollo 以及express 代碼還是很清晰的。
參考資料
https://docs.nestjs.com/
https://github.com/nestjs/nest/tree/master/sample
