@wildcards/reason-apollo
Version:
Using Apollo client 2 with Reason
47 lines (39 loc) • 1.86 kB
JavaScript
// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE
import * as ApolloLinkHttp from "apollo-link-http";
import * as Js_null_undefined from "bs-platform/lib/es6/js_null_undefined.js";
import * as ApolloLinkError from "apollo-link-error";
import * as ApolloLinkContext from "apollo-link-context";
import * as ApolloUploadClient from "apollo-upload-client";
function createHttpLink(uri, includeExtensions, $$fetch, headers, credentials, fetchOptions, param) {
return new ApolloLinkHttp.HttpLink(/* record */[
/* uri */uri,
/* includeExtensions */Js_null_undefined.fromOption(includeExtensions),
/* fetch */Js_null_undefined.fromOption($$fetch),
/* headers */Js_null_undefined.fromOption(headers),
/* credentials */Js_null_undefined.fromOption(credentials),
/* fetchOptions */Js_null_undefined.fromOption(fetchOptions)
]);
}
function createUploadLink(uri, $$fetch, fetchOptions, credentials, headers, includeExtensions, param) {
return ApolloUploadClient.createUploadLink(/* record */[
/* uri */Js_null_undefined.fromOption(uri),
/* fetch */Js_null_undefined.fromOption($$fetch),
/* fetchOptions */Js_null_undefined.fromOption(fetchOptions),
/* credentials */Js_null_undefined.fromOption(credentials),
/* headers */Js_null_undefined.fromOption(headers),
/* includeExtensions */Js_null_undefined.fromOption(includeExtensions)
]);
}
function createContextLink(contextHandler) {
return ApolloLinkContext.setContext(contextHandler);
}
function createErrorLink(errorHandler) {
return ApolloLinkError.onError(errorHandler);
}
export {
createHttpLink ,
createUploadLink ,
createContextLink ,
createErrorLink ,
}
/* apollo-link-http Not a pure module */