From 2caadf90d8325e1c7b3c1d119df0d8b8b07b7011 Mon Sep 17 00:00:00 2001 From: "Wilson, James" Date: Tue, 18 Dec 2018 10:49:03 -0600 Subject: [PATCH] Even better graphql error handling --- package.json | 2 +- src/requestAdapters/Graphql.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6ceabf1..8d3aa0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saloon", - "version": "1.4.1", + "version": "1.4.2", "description": "An E2E Test Seeder for Enterprise Web Applications", "main": "dist/saloon.js", "module": "dist/module/main.js", diff --git a/src/requestAdapters/Graphql.js b/src/requestAdapters/Graphql.js index bcec923..3a0d229 100644 --- a/src/requestAdapters/Graphql.js +++ b/src/requestAdapters/Graphql.js @@ -23,7 +23,7 @@ class GraphqlAdapter extends BaseRequestAdapter { }, }) .then(({ data }) => { - if (!data.data && data.errors.length > 0) { + if (data.errors.length > 0) { throw new Error(JSON.stringify(data.errors)); } return data;