mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 10:11:40 -05:00
change how koa error response is returned
This commit is contained in:
parent
38bb67bf6f
commit
be01aee734
1 changed files with 4 additions and 1 deletions
|
@ -54,6 +54,9 @@ export function graphiqlKoa(options: GraphiQL.GraphiQLData | KoaGraphiQLOptionsF
|
||||||
GraphiQL.resolveGraphiQLString(query, options, ctx).then(graphiqlString => {
|
GraphiQL.resolveGraphiQLString(query, options, ctx).then(graphiqlString => {
|
||||||
ctx.set('Content-Type', 'text/html');
|
ctx.set('Content-Type', 'text/html');
|
||||||
ctx.body = graphiqlString;
|
ctx.body = graphiqlString;
|
||||||
}, error => ctx.throw(error.message, 500));
|
}, error => {
|
||||||
|
ctx.status = 500;
|
||||||
|
ctx.body = error.message;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue