UNPKG

568 BJavaScriptView Raw
1import { request } from "@octokit/request";
2import { getUserAgent } from "universal-user-agent";
3import { VERSION } from "./version";
4import { withDefaults } from "./with-defaults";
5export const graphql = withDefaults(request, {
6 headers: {
7 "user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,
8 },
9 method: "POST",
10 url: "/graphql",
11});
12export { GraphqlResponseError } from "./error";
13export function withCustomRequest(customRequest) {
14 return withDefaults(customRequest, {
15 method: "POST",
16 url: "/graphql",
17 });
18}