Closed mflores-verys closed 2 years ago
From Koa perspective, you could have a middleware doing this job after graphqlHTTP
has been run:
const app = new Koa();
app.use(async (ctx, next) => {
await next();
// read the response object here!
console.log(ctx.response.body);
});
app.use(
mount(
'/graphql',
graphqlHTTP({
schema: MyGraphQLSchema,
graphiql: true,
}),
),
);
I'd like to read the response object that's going to be sent back to the requestor. When I interrogate the
response
object that's passed when providing a function tokoa-graphql
, it seems it's before the final response has been composed.i.e.