Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-http

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-http - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

76

index.dist.js

@@ -7,2 +7,6 @@ 'use strict';

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
var _stringify = require('babel-runtime/core-js/json/stringify');

@@ -12,2 +16,6 @@

var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _regenerator = require('babel-runtime/regenerator');

@@ -25,8 +33,4 @@

var _promise2 = require('babel-runtime/core-js/promise');
var _promise3 = _interopRequireDefault(_promise2);
var _makeRequest = function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ax, config) {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ax, config) {
var result, response, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, err;

@@ -56,3 +60,3 @@

if (!_context.t0.data.hasOwnProperty('errors')) {
if (!(_context.t0 && _context.t0.data && _context.t0.data.hasOwnProperty('errors'))) {
_context.next = 33;

@@ -110,3 +114,3 @@ break;

case 33:
console.error('[GQLHTTP] Error: ' + _context.t0.data);
console.error('[GQLHTTP] Error: ' + _context.t0);

@@ -123,4 +127,5 @@ case 34:

}));
return function _makeRequest(_x, _x2) {
return ref.apply(this, arguments);
return _ref.apply(this, arguments);
};

@@ -150,10 +155,2 @@ }();

function _promise(fn) {
return new _promise3.default(function (res, rej) {
fn(function (err, succ) {
return err ? rej(err) : res(succ);
});
});
}
function graphQLClient(host, config) {

@@ -168,3 +165,5 @@ if (config === undefined) {

query: function query(_query, variables, opName) {
return _makeRequest(ax, {
var extra = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
return _makeRequest(ax, (0, _extends3.default)({
params: {

@@ -175,32 +174,23 @@ query: _query,

}
});
}, extra));
},
mutate: function mutate(query, variables, opName) {
var _this = this;
var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
return (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2() {
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
return _context2.abrupt('return', _makeRequest(ax, {
data: {
query: query,
variables: variables,
opName: opName
},
headers: {
'Content-Type': 'application/json'
},
// 'Content-Encoding': 'gzip'
method: 'POST'
}));
var _ref2$headers = _ref2.headers;
var headers = _ref2$headers === undefined ? {} : _ref2$headers;
var restExtra = (0, _objectWithoutProperties3.default)(_ref2, ['headers']);
case 1:
case 'end':
return _context2.stop();
}
}
}, _callee2, _this);
}))();
// @TODO Get Gzip support working
return _makeRequest(ax, (0, _extends3.default)({
data: {
query: query,
variables: variables,
opName: opName
},
headers: (0, _extends3.default)({
'Content-Type': 'application/json'
}, headers),
method: 'POST'
}, restExtra));
}

@@ -207,0 +197,0 @@ };

{
"name": "graphql-http",
"version": "0.0.3",
"version": "0.0.4",
"description": "A GraphQL client for executing GraphQL queries over HTTP.",

@@ -5,0 +5,0 @@ "main": "index.dist.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc