chore: Handle 404 not found errors

This commit is contained in:
Faruk AYDIN
2021-10-04 22:16:06 +02:00
committed by Ali BARIN
parent c0f022a1b0
commit 4039e520d6
2 changed files with 11 additions and 8 deletions

View File

@@ -7,7 +7,11 @@ const stream: StreamOptions = {
};
const registerGraphQLToken = () => {
morgan.token("graphql-query", (req: Request) => `GraphQL ${req.body.query}`);
morgan.token("graphql-query", (req: Request) => {
if(req.body.query) {
return `GraphQL ${req.body.query}`
}
});
};
registerGraphQLToken();