Cleaning it all a bit before the call (didn't heavy test this)

This commit is contained in:
Nikola Bjelo committed 2018-10-11 17:52:17 +02:00
1 parent e643b4dc8d
commit f04904c236
4 files changed
+56 -25

No files matched your search

+8 -1
View File
@@ -35,7 +35,14 @@ export const createRemoteSchema = async (uri) => {
}
export const createTransformedRemoteSchema = async (prefix, uri) => {
const schema = await createRemoteSchema(uri)
var schema
try {
schema = await createRemoteSchema(uri)
} catch (error) {
console.log(`An error occured while fetching ${prefix} schema :`)
console.log(error)
return false
}
const transformedSchema = transformSchema(schema, [
new RenameTypes((name) => prefix + capitalize(name)),
new RenameRootFields((operation, name) => prefix + capitalize(name))