Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const morgan = require('morgan');
- morgan.token('graphql-query', req => {
- const { query, variables, operationName } = req.body;
- if (operationName !== 'IntrospectionQuery') {
- return `GRAPHQL: \nOperation Name: ${operationName} \nQuery: ${query} \nVariables: ${JSON.stringify(
- variables,
- )}`;
- }
- return true;
- });
- app.use(morgan(':graphql-query'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement