Webhooks don't indicate document creation, update or deletion. Possible solution found.
Last updated: Jan 3, 2023
Hi all. It appears that the webhooks don't provide any information (with the payload or headers) on whether a document was created, updated or deleted, which seems quite odd because you can limit the entire webhook based on this. Is this correct?
Jan 3, 2023, 11:02 AM
I found this as a solution - which I think would be useful to share in the Webhooks documentation:
Turns out that this projection mimics the older hooks payload format. I don’t think there will be more than a single document passed in the new GROQ based webhooks, so it still feels a bit awkward to jump through hoops like that. It would be better to have a custom HTTP header that passes the operation (create/update/delete) along. Or maybe a GROQ function to use within the projection.
Jan 3, 2023, 7:05 PM
Yeah, that is quite verbose and using a header would be much easier.