graphql-config-parser
Advanced tools
Comparing version 0.1.1 to 1.0.0
{ | ||
"name": "graphql-config-parser", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -53,3 +53,5 @@ "use strict"; | ||
method: 'POST', | ||
body: JSON.stringify(introspectionQuery_1.introspectionQuery), | ||
body: JSON.stringify({ | ||
query: introspectionQuery_1.introspectionQuery, | ||
}), | ||
headers: Object.assign({ | ||
@@ -60,4 +62,15 @@ 'Content-Type': 'application/json', | ||
.then((res) => { | ||
console.log(`Loaded GraphQL schema from ${configRequest.url}`); | ||
return res.json(); | ||
if (res.ok) { | ||
return res.json() | ||
.then((schema) => { | ||
console.log(`Loaded GraphQL schema from ${configRequest.url}`); | ||
return schema; | ||
}); | ||
} | ||
else { | ||
return res.text() | ||
.then((text) => { | ||
throw new Error(`${res.statusText}: ${text}`); | ||
}); | ||
} | ||
}); | ||
@@ -64,0 +77,0 @@ default: throw new Error(`Invalid config: ${JSON.stringify(config)}`); |
@@ -66,3 +66,5 @@ import { isWebUri } from 'valid-url' | ||
method: 'POST', | ||
body: JSON.stringify(introspectionQuery), | ||
body: JSON.stringify({ | ||
query: introspectionQuery, | ||
}), | ||
headers: Object.assign( | ||
@@ -76,4 +78,14 @@ { | ||
.then((res) => { | ||
console.log(`Loaded GraphQL schema from ${configRequest.url}`) | ||
return res.json() | ||
if (res.ok) { | ||
return res.json() | ||
.then((schema) => { | ||
console.log(`Loaded GraphQL schema from ${configRequest.url}`) | ||
return schema | ||
}) | ||
} else { | ||
return res.text() | ||
.then((text) => { | ||
throw new Error(`${res.statusText}: ${text}`) | ||
}) | ||
} | ||
}) | ||
@@ -80,0 +92,0 @@ default: throw new Error(`Invalid config: ${JSON.stringify(config)}`) |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15131
191
0
1