项目作者: nodejh

项目描述 :
egg graphql plugin
高级语言: JavaScript
项目地址: git://github.com/nodejh/egg-plugin-graphql.git
创建时间: 2019-10-12T08:20:08Z
项目社区:https://github.com/nodejh/egg-plugin-graphql

开源协议:MIT License

下载


egg-plugin-graphql

NPM version
build status
Test coverage
David deps
Known Vulnerabilities
npm download

Egg GraphQL 插件。

使用方法

安装

  1. $ npm i egg-plugin-graphql --save

开启插件

  1. // config/plugin.js
  2. exports.graphql = {
  3. enable: true,
  4. package: 'egg-plugin-graphql',
  5. };

配置

  1. // config.default.js
  2. // 配置 graphql
  3. exports.graphql = {
  4. router: '/graphql',
  5. // 是否创建默认的空 schema
  6. defaultEmptySchema: false,
  7. // 是否加载开发者工具 (playground), 默认开启, 路由同 router 字段, 使用浏览器打开该可见
  8. playground: true,
  9. };
  10. // 使用 graphql 插件,拦截请求
  11. exports.middleware = [ 'graphql' ];

Example

GraphQL 实践系列文章

提问交流

请到 issues 异步交流。

License

MIT