Open ojongerius opened 6 years ago
'apollo-server-core' is throwing the error but out 'apollo-server-lambda' hander is catching the error and adding the error message https://github.com/apollographql/apollo-server/blob/master/packages/apollo-server-lambda/src/lambdaApollo.ts
try {
gqlResponse = await runHttpQuery([event, lambdaContext], {
method: event.httpMethod,
options: options,
query: query,
});
headers['Content-Type'] = 'application/json';
statusCode = 200;
} catch (error) {
if ('HttpQueryError' !== error.name) {
throw error;
}
headers = error.headers;
statusCode = error.statusCode;
gqlResponse = error.message;
}
Hitting Graphql with an empty body is not supported, but we currently expose an error from apollo-server, which we should dress up a little nicer.
Find code that generates the error at https://github.com/apollographql/apollo-server/blob/master/packages/apollo-server-core/src/runHttpQuery.ts#L67