@hot-chocolate/plugin-request
v0.1.7
Published
js sandbox on browser
Downloads
6
Maintainers
Readme
@hot-chocolate/plugin-request
安装
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'
}
},
})
]
)