doesn't work. When one post gets updated, I want all other posts that reference that post to get updated as well, does anyone have a workaround for this? For example: I have a 'theme' document type. Then I have lots of 'blog' documents that reference different themes. When I edit the title of a theme, all these blog posts need to get revalidated in NextJS. NextJS doesn't have the option to do dynamic revalidation yet, so I was hoping that Sanity could send the relevant blog post urls to the revalidation API, but apparently that doesn't work?
In other words: is there a way to do sub-queries/groq queries in a webhook?
Sep 5, 2022, 8:07 PM
A bit more work on your end, but can the endpoint receiving the Sanity webhook do the query for all relevant documents (
in this case) that need to be revalidated, then feed those to the revalidate function in Next?
Sep 5, 2022, 8:21 PM
yeah that's certainly possible, thanks for the suggestion! I was hoping I could do it without any extra api calls, but I think this is the only way at the moment.