egg-plugin-graphql

0.1.18 • Public • Published

egg-plugin-graphql

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

Egg GraphQL 插件。

使用方法

安装

$ npm i egg-plugin-graphql --save

开启插件

// config/plugin.js
exports.graphql = {
  enable: true,
  package: 'egg-plugin-graphql',
};

配置

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

Example

GraphQL 实践系列文章

提问交流

请到 issues 异步交流。

License

MIT

Package Sidebar

Install

npm i egg-plugin-graphql

Weekly Downloads

0

Version

0.1.18

License

MIT

Unpacked Size

7.81 kB

Total Files

7

Last publish

Collaborators

  • nodejh