setup-node/node_modules/@octokit/graphql/lib/with-defaults.js

14 lines
338 B
JavaScript
Raw Permalink Normal View History

2019-08-06 03:18:52 +08:00
module.exports = withDefaults
const graphql = require('./graphql')
function withDefaults (request, newDefaults) {
const newRequest = request.defaults(newDefaults)
const newApi = function (query, options) {
return graphql(newRequest, query, options)
}
newApi.defaults = withDefaults.bind(null, newRequest)
return newApi
}