Sanity recently launched their GROQ-powered webhooks that I wrote about, and they are really powerful! There is even a guide that explains projections, and one that explains filters.
The bug
I created a simple webhook like this, that posts a message to Slack whenever a new document of type user
is created.
![](https://blog.novacare.no/content/images/2021/11/image-25.png)
When I later updated the webhook to only run for the production dataset, using the top drop-down, the webhook continued to fire on all datasets.
The workaround
One possible solution is doing the dataset filtering in GROQ, and not with the dropdown.
![](https://blog.novacare.no/content/images/2021/11/image-26.png)
With this update, the webhook is only triggered for the production dataset.
Fixed
As of January 19th 2022, the bug is fixed and the workaround is no longer needed.