UNPKG

383 BJavaScriptView Raw
1import { graphql } from "./graphql";
2export function withDefaults(request, newDefaults) {
3 const newRequest = request.defaults(newDefaults);
4 const newApi = (query, options) => {
5 return graphql(newRequest, query, options);
6 };
7 return Object.assign(newApi, {
8 defaults: withDefaults.bind(null, newRequest),
9 endpoint: newRequest.endpoint,
10 });
11}