UNPKG

1.31 kBJavaScriptView Raw
1"use strict";
2
3var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
4
5Object.defineProperty(exports, "__esModule", {
6 value: true
7});
8exports.default = void 0;
9
10var _objectSpread2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectSpread"));
11
12var _axios = _interopRequireDefault(require("axios"));
13
14var _spread = _interopRequireDefault(require("@sharyn/util/spread"));
15
16var _spreadIf = _interopRequireDefault(require("@sharyn/util/spread-if"));
17
18// flow-disable-next-line
19// flow-disable-next-line
20var call = function call(_ref) {
21 var _authorizationBearer;
22
23 var urlBase = _ref.urlBase,
24 _ref$urlPath = _ref.urlPath,
25 urlPath = _ref$urlPath === void 0 ? '/graphql' : _ref$urlPath,
26 body = _ref.body,
27 authorizationBearer = _ref.authorizationBearer,
28 cookie = _ref.cookie;
29 return _axios.default.post("".concat(urlBase).concat(urlPath), body, {
30 headers: (0, _objectSpread2.default)({}, (0, _spreadIf.default)(authorizationBearer, {
31 Authorization: "Bearer ".concat((_authorizationBearer = authorizationBearer) !== null && _authorizationBearer !== void 0 ? _authorizationBearer : 'undefined')
32 }), (0, _spread.default)({
33 cookie: cookie
34 }))
35 });
36};
37
38var _default = call;
39exports.default = _default;
\No newline at end of file