craftcms / webhooks

Plugin for integrating Craft with Zapier and IFTTT.
https://plugins.craftcms.com/webhooks
MIT License
84 stars 12 forks source link

Possibility to add source of change? (namely, graphql) #40

Closed jishi closed 3 years ago

jishi commented 3 years ago

Description

I'm using the webhook as a sort of post-save decoration service, which means i catch saves of entries, send the webhook, do some external data preparation and then updating the entry via graphQL. I realize this might not be the most common way of doing things, but the problem I run into is that it will be causing an infinite update loop because graphQL updates of entries trigger the same webhook.

I seem to neither be able to identify changed fields of the entry, or the actual source of the change, hence, no way of filtering out hooks that are trigger via GraphQL. Would there be such a possibility?

I was hoping that the duplicateOf property was actually the previous revision of the entry, but that doesn't seem to be the case. I am somewhat confused regarding the duplicateOf entity and the IDs that are passed with the payload. The sender object always have a different ID than the duplicateOf object, but it seems to be the duplicateOf that has the "correct" ID of the entry...?