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

graphql-helper

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-helper - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

4

lib.js

@@ -108,3 +108,3 @@ 'use strict';

return request(queryString, variables).then(function (r) {
return r.errors ? Promise.reject(r.errors) : Promise.resolve(r.data);
return r.errors ? Promise.reject(r.errors) : r.data ? Promise.resolve(r.data) : Promise.reject([{ message: 'Request error' }]);
});

@@ -148,3 +148,3 @@ }, { __GRAPHQL_QUERY__: true,

}).then(function (r) {
return r.errors ? Promise.reject(r.errors) : Promise.resolve(r.data.payload);
return r.errors ? Promise.reject(r.errors) : r.data ? Promise.resolve(r.data.payload) : Promise.reject([{ message: 'Request error' }]);
});

@@ -151,0 +151,0 @@ }, { __GRAPHQL_MUTATION__: true,

{
"name": "graphql-helper",
"version": "0.0.8",
"version": "0.0.9",
"description": "A simple helper library for making GraphQL queries. For browser usage, ensure that you have a Promise polyfill.",

@@ -5,0 +5,0 @@ "main": "lib.js",

@@ -100,4 +100,10 @@ /* @flow */

return operationDefinitions[name] = decorate
( variables => request(queryString, variables)
.then(r => r.errors ? Promise.reject(r.errors) : Promise.resolve(r.data))
( variables =>
request(queryString, variables)
.then(r => r.errors
? Promise.reject(r.errors)
: r.data
? Promise.resolve(r.data)
: Promise.reject([{ message: 'Request error' }])
)
, { __GRAPHQL_QUERY__: true

@@ -148,3 +154,8 @@ , operationName: name

}
).then(r => r.errors ? Promise.reject(r.errors) : Promise.resolve(r.data.payload))
).then(r => r.errors
? Promise.reject(r.errors)
: r.data
? Promise.resolve(r.data.payload)
: Promise.reject([{ message: 'Request error' }])
)
, { __GRAPHQL_MUTATION__: true

@@ -151,0 +162,0 @@ , operationName: capitalized

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