diff --git a/plugins/talk-plugin-akismet/server/hooks.js b/plugins/talk-plugin-akismet/server/hooks.js index b06557783..4e24af4b3 100644 --- a/plugins/talk-plugin-akismet/server/hooks.js +++ b/plugins/talk-plugin-akismet/server/hooks.js @@ -28,8 +28,11 @@ let enabled = true; module.exports = { RootMutation: { createComment: { - async pre(_, { input }, { loaders, parent: req }) { - // If the key validation failed, then we can't run with the client. + async pre(_, { input }, ctx) { + const req = ctx.parent.parent; + const loaders = ctx.loaders; + + //If the key validation failed, then we can't run with the client. if (!enabled) { debug('not enabled, passing'); return;