2021-02-08 12:58:32 +08:00
|
|
|
import { request } from "@octokit/request";
|
|
|
|
import { getUserAgent } from "universal-user-agent";
|
|
|
|
import { VERSION } from "./version";
|
|
|
|
import { withDefaults } from "./with-defaults";
|
|
|
|
export const graphql = withDefaults(request, {
|
|
|
|
headers: {
|
2021-06-04 22:19:14 +08:00
|
|
|
"user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,
|
2021-02-08 12:58:32 +08:00
|
|
|
},
|
|
|
|
method: "POST",
|
2021-06-04 22:19:14 +08:00
|
|
|
url: "/graphql",
|
2021-02-08 12:58:32 +08:00
|
|
|
});
|
|
|
|
export function withCustomRequest(customRequest) {
|
|
|
|
return withDefaults(customRequest, {
|
|
|
|
method: "POST",
|
2021-06-04 22:19:14 +08:00
|
|
|
url: "/graphql",
|
2021-02-08 12:58:32 +08:00
|
|
|
});
|
|
|
|
}
|