graphql-request
Advanced tools
Comparing version 1.1.3 to 1.2.0
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -80,7 +88,7 @@ return new (P || (P = Promise))(function (resolve, reject) { | ||
result = _a.sent(); | ||
if (response.ok && !result.errors) { | ||
if (response.ok && !result.errors && result.data) { | ||
return [2 /*return*/, result.data]; | ||
} | ||
else { | ||
throw new types_1.ClientError({ data: result.data, errors: result.errors, status: response.status }, { query: query, variables: variables }); | ||
throw new types_1.ClientError(__assign({}, result, { status: response.status }), { query: query, variables: variables }); | ||
} | ||
@@ -87,0 +95,0 @@ return [2 /*return*/]; |
@@ -19,3 +19,3 @@ export declare type Variables = { | ||
data?: any; | ||
errors: GraphQLError[]; | ||
errors?: GraphQLError[]; | ||
status: number; | ||
@@ -22,0 +22,0 @@ [key: string]: any; |
{ | ||
"name": "graphql-request", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"main": "dist/src/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "./dist/src/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24693
360