@hot-chocolate/plugin-request
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

@hot-chocolate/plugin-request

npm version npm download

安装

npm install @hot-chocolate/plugin-request

使用

import {
  Manager
} from 'hot-chocolate';
import {
  createSandboxRequestPlugin
} from '@hot-chocolate/plugin-request';

new Manager(
  [...],
  [
    createSandboxRequestPlugin({
      // 请求发送前的勾子
      beforeRequest: (
        options, // { url: string, method: string } 请求参数
        application // 启动的application
      ) => {
        // 返回新的请求url及method
        return {
          url: 'xxxx',
          method: 'POST'
        }
      },

    })
  ]
)

/@hot-chocolate/plugin-request/

    Package Sidebar

    Install

    npm i @hot-chocolate/plugin-request

    Weekly Downloads

    0

    Version

    0.1.7

    License

    MIT

    Unpacked Size

    6.81 kB

    Total Files

    5

    Last publish

    Collaborators

    • ignous