Skip to content

Commit

Permalink
re-run policies after the resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
romanmandryk committed Jun 16, 2020
1 parent 7284703 commit 5d21605
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/resolvers-builder.js
Expand Up @@ -53,6 +53,9 @@ const buildMutation = (mutationName, config) => {
if (_.isError(result)) {
throw result;
}
//run policies again with response data (not ideal - should be composable)
ctx.response.body = result;
await policiesMiddleware(ctx);

return transformOutput(result);
};
Expand Down Expand Up @@ -115,7 +118,9 @@ const buildQuery = (queryName, config) => {
if (_.isError(result)) {
throw result;
}

//run policies again with response data (not ideal - should be composable)
ctx.response.body = result;
await policiesMiddleware(ctx);
return result;
};
};
Expand Down

0 comments on commit 5d21605

Please sign in to comment.