Skip to content

Commit

Permalink
1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
raxpost committed Jun 2, 2018
1 parent cd7c340 commit f83eb4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
15 changes: 11 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ var _assign = require('babel-runtime/core-js/object/assign');

var _assign2 = _interopRequireDefault(_assign);

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
Expand Down Expand Up @@ -62,8 +66,9 @@ var schemaFromEndpoints = function schemaFromEndpoints(endpoints, proxyUrl, head
var resolver = function resolver(endpoint, proxyUrl) {
var customHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(_, args, opts) {
var proxy, req, res;
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(_, args, opts) {
var proxy, req, _opts$headers, host, otherHeaders, res;

return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
Expand All @@ -72,7 +77,9 @@ var resolver = function resolver(endpoint, proxyUrl) {
req = endpoint.request(args, proxy);

if (opts.headers) {
req.headers = (0, _assign2.default)(customHeaders, req.headers, opts.headers);
_opts$headers = opts.headers, host = _opts$headers.host, otherHeaders = (0, _objectWithoutProperties3.default)(_opts$headers, ['host']);

req.headers = (0, _assign2.default)(customHeaders, req.headers, otherHeaders);
}
_context.next = 5;
return (0, _requestPromise2.default)(req);
Expand Down Expand Up @@ -113,7 +120,7 @@ var getFields = function getFields(endpoints, isMutation, gqlTypes, proxyUrl, he
};

var build = function () {
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(swaggerPath) {
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(swaggerPath) {
var proxyUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var headers = arguments[2];
var swaggerSchema, refs, endpoints, schema;
Expand Down
4 changes: 2 additions & 2 deletions lib/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var getSuccessResponse = function getSuccessResponse(responses) {
};

var loadSchema = exports.loadSchema = function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(pathToSchema) {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(pathToSchema) {
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
Expand All @@ -84,7 +84,7 @@ var loadSchema = exports.loadSchema = function () {
}();

var loadRefs = exports.loadRefs = function () {
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(pathToSchema) {
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(pathToSchema) {
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swagger-to-graphql",
"version": "1.3.0",
"version": "1.3.3",
"author": "Roman Krivtsov",
"bin": "./bin/swagger2graphql",
"dependencies": {
Expand All @@ -10,7 +10,7 @@
"js-yaml": "^3.8.4",
"json-schema-ref-parser": "^3.1.2",
"lodash": "^4.16.4",
"node-request-by-swagger": "1.1.0",
"node-request-by-swagger": "1.1.3",
"request": "^2.75.0",
"request-promise": "^4.1.1",
"yargs": "^8.0.2"
Expand Down

0 comments on commit f83eb4c

Please sign in to comment.