@octokit/graphql
Version:
GitHub GraphQL API client for browsers and Node
16 lines (15 loc) • 438 B
JavaScript
import { request as Request } from "@octokit/request";
import { graphql } from "./graphql.js";
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: newRequest.endpoint
});
}
export {
withDefaults
};