@octokit/graphql
Advanced tools
Comparing version 4.5.2 to 4.5.3
@@ -8,3 +8,3 @@ 'use strict'; | ||
const VERSION = "4.5.2"; | ||
const VERSION = "4.5.3"; | ||
@@ -16,2 +16,5 @@ class GraphqlError extends Error { | ||
Object.assign(this, response.data); | ||
Object.assign(this, { | ||
headers: response.headers | ||
}); | ||
this.name = "GraphqlError"; | ||
@@ -49,3 +52,10 @@ this.request = request; // Maintains proper stack trace (only available on V8) | ||
if (response.data.errors) { | ||
const headers = {}; | ||
for (const key of Object.keys(response.headers)) { | ||
headers[key] = response.headers[key]; | ||
} | ||
throw new GraphqlError(requestOptions, { | ||
headers, | ||
data: response.data | ||
@@ -52,0 +62,0 @@ }); |
@@ -6,2 +6,3 @@ export class GraphqlError extends Error { | ||
Object.assign(this, response.data); | ||
Object.assign(this, { headers: response.headers }); | ||
this.name = "GraphqlError"; | ||
@@ -8,0 +9,0 @@ this.request = request; |
@@ -29,3 +29,8 @@ import { GraphqlError } from "./error"; | ||
if (response.data.errors) { | ||
const headers = {}; | ||
for (const key of Object.keys(response.headers)) { | ||
headers[key] = response.headers[key]; | ||
} | ||
throw new GraphqlError(requestOptions, { | ||
headers, | ||
data: response.data, | ||
@@ -32,0 +37,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "4.5.2"; | ||
export const VERSION = "4.5.3"; |
@@ -0,1 +1,2 @@ | ||
import { ResponseHeaders } from '@octokit/types'; | ||
import { GraphQlEndpointOptions, GraphQlQueryResponse } from "./types"; | ||
@@ -5,4 +6,5 @@ export declare class GraphqlError<ResponseData> extends Error { | ||
constructor(request: GraphQlEndpointOptions, response: { | ||
headers: ResponseHeaders; | ||
data: Required<GraphQlQueryResponse<ResponseData>>; | ||
}); | ||
} |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "4.5.2"; | ||
export declare const VERSION = "4.5.3"; |
import { request } from '@octokit/request'; | ||
import { getUserAgent } from 'universal-user-agent'; | ||
const VERSION = "4.5.2"; | ||
const VERSION = "4.5.3"; | ||
@@ -11,2 +11,3 @@ class GraphqlError extends Error { | ||
Object.assign(this, response.data); | ||
Object.assign(this, { headers: response.headers }); | ||
this.name = "GraphqlError"; | ||
@@ -49,3 +50,8 @@ this.request = request; | ||
if (response.data.errors) { | ||
const headers = {}; | ||
for (const key of Object.keys(response.headers)) { | ||
headers[key] = response.headers[key]; | ||
} | ||
throw new GraphqlError(requestOptions, { | ||
headers, | ||
data: response.data, | ||
@@ -52,0 +58,0 @@ }); |
{ | ||
"name": "@octokit/graphql", | ||
"description": "GitHub GraphQL API client for browsers and Node", | ||
"version": "4.5.2", | ||
"version": "4.5.3", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
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
33736
313