Browse Source

api: Fixed client hiding graphql errors

1.0
Gisle Aune 6 years ago
parent
commit
6591ad0245
  1. 7
      rpdata/client.js

7
rpdata/client.js

@ -20,13 +20,6 @@ function query(query, variables = {}, options = {}) {
body: JSON.stringify({query: query.length > 256 ? compressQuery(query || "") : query, variables, operationName: options.operationName}), body: JSON.stringify({query: query.length > 256 ? compressQuery(query || "") : query, variables, operationName: options.operationName}),
credentials: "include", credentials: "include",
}).then(res => { }).then(res => {
if (!res.ok) {
return Promise.reject([{
message: `HTTP: ${res.statusText}`,
location: null,
}])
}
return res.json() return res.json()
}).then(json => { }).then(json => {
if (json.errors != null && json.errors.length > 0) { if (json.errors != null && json.errors.length > 0) {

Loading…
Cancel
Save