I've setup a webhook to trigger the revalidation of specific paths in my nextjs (v12.2) project.
Unfortuantely I'm struggling with the limited data provided in the payload. Specifically the two points:
- Localisation - I have several locales setup in Prismic, however the payload does not separate documents by the locale and therefore I'll have to rebuild every single document on every single locale, which as you can imagine is really ineffcient.
Is this something the development team would consider adding? Having this separation would considerably improve the usability of the webhook functionality for manually purging cache on document publish/unpublish
Either having the documents separated by locale e.g:
"documents": [
"en-gb": [ <array of document ids for this locale],
"en-us": [ <array of document ids for this locale],
...
],
or even just listing the locales where the changes have occured e.g:
"localisation": [
"en-gb",
"en-us",
...
],
- Document types - The document array, whilst helpful, is somewhat limited in how useful this is. I think having an array of the document types would be more helpful for revalidating the specific paths.
Currently, I'm having to query the client by using client.getAllByIDs
in order to access the document UID and type (which for the most part is what's used to generate the page path.