mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 17:51:40 -05:00
adding in the callback to express package to allow middleware chaining throughout the application
This commit is contained in:
parent
f20161bb6e
commit
3d03295974
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue