troi mua qua

This commit is contained in:
2024-10-07 20:46:20 +07:00
parent 30159e01ad
commit 5c836323b0
19 changed files with 411 additions and 2 deletions

View File

@@ -22,6 +22,17 @@ export class GraphQLValidationMiddleware implements NestMiddleware {
],
});
}
// handle query only contain \n
if (query.trim() === '') {
return res.status(400).json({
errors: [
{
message:
'Must provide a valid GraphQL query, mutation, or subscription.',
},
],
});
}
}
// Continue to the next middleware or GraphQL handler