blob: 6ea309e3ab0b4377b7c3a3c14fa7e2a5226839d1 [file] [log] [blame]
import { request as Request } from "@octokit/request";
import { graphql } from "./graphql";
export function withDefaults(request, newDefaults) {
const newRequest = request.defaults(newDefaults);
const newApi = (query, options) => {
return graphql(newRequest, query, options);
};
return Object.assign(newApi, {
defaults: withDefaults.bind(null, newRequest),
endpoint: Request.endpoint,
});
}