egg-plugin-graphql
Egg GraphQL 插件。
使用方法
安装
$ npm i egg-plugin-graphql --save
开启插件
// config/plugin.jsexportsgraphql = enable: true package: 'egg-plugin-graphql';
配置
// config.default.js // 配置 graphqlexportsgraphql = router: '/graphql' // 是否创建默认的空 schema defaultEmptySchema: false // 是否加载开发者工具 (playground), 默认开启, 路由同 router 字段, 使用浏览器打开该可见 playground: true; // 使用 graphql 插件,拦截请求exportsmiddleware = 'graphql' ;
Example
- example/simple 一个简单的例子
- example/modular-schema 模块化 schema
GraphQL 实践系列文章
提问交流
请到 issues 异步交流。