Trigger Webhook in custom GraphQL mutation method

System Information
  • Strapi Version: 3.6
  • Operating System: Windows
  • Database: MongoDB
  • Node Version: 14.6.1

Hi,

I have created a custom mutation for the GraphQL via a custom schema file and the Controller file.

    async approveCard(ctx) {
    let data = ctx.request.body;
    let user = ctx.state.user;

    let card = await strapi.services.utils.findCard(data.cardId);
    let box = await strapi.services.utils.findBox(card.box);

    await strapi.query('card').update({id: data.cardId}, {
        approval: {
            approved: true,
            approvingAdmin: user.id
        }
    });

    return strapi.query('card').findOne({id: data.cardId});

}

When creating the card, using a non-customised method, a webhook is triggered. However, when using this custom method, despite using the “strapi.query” methods, webhooks are not triggered.

Is there something I need to do to get the update above to trigger registered Webhooks?

Thanks!