Skip to content

Commit 5d21605

Browse files
committed
re-run policies after the resolver
1 parent 7284703 commit 5d21605

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

services/resolvers-builder.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ const buildMutation = (mutationName, config) => {
5353
if (_.isError(result)) {
5454
throw result;
5555
}
56+
//run policies again with response data (not ideal - should be composable)
57+
ctx.response.body = result;
58+
await policiesMiddleware(ctx);
5659

5760
return transformOutput(result);
5861
};
@@ -115,7 +118,9 @@ const buildQuery = (queryName, config) => {
115118
if (_.isError(result)) {
116119
throw result;
117120
}
118-
121+
//run policies again with response data (not ideal - should be composable)
122+
ctx.response.body = result;
123+
await policiesMiddleware(ctx);
119124
return result;
120125
};
121126
};

0 commit comments

Comments
 (0)