adding in the callback to express package to allow middleware chaining throughout the application

This commit is contained in:
Andrew Pratt 2017-07-16 22:39:51 -07:00
parent f20161bb6e
commit 3d03295974

View file

@ -35,6 +35,7 @@ export function graphqlExpress(options: GraphQLOptions | ExpressGraphQLOptionsFu
res.setHeader('Content-Type', 'application/json');
res.write(gqlResponse);
res.end();
next();
}, (error: HttpQueryError) => {
if ( 'HttpQueryError' !== error.name ) {
return next(error);
@ -49,6 +50,7 @@ export function graphqlExpress(options: GraphQLOptions | ExpressGraphQLOptionsFu
res.statusCode = error.statusCode;
res.write(error.message);
res.end();
next(false);
});
};
}