Skip to content

Commit 20f7162

Browse files
committed
Correctly assemble error message
1 parent ea3adfe commit 20f7162

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

codegen/schema/get-gql-schema.mjs

+5-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ export async function getGqlSchema ({ moduleName, cache, url, token }) {
2525
)
2626

2727
const { data: schema, errors } = await response.json()
28-
28+
2929
if (errors) {
30-
throw new Error(errors)
30+
throw new Error(errors
31+
.map(err => "- " + err.message)
32+
.join('\n')
33+
)
3134
}
3235

3336
return { moduleName, cache, schema }

0 commit comments

Comments
 (0)