Hey @mat_jack1, thanks !
If you change a linked record we should also update the others. If we did that, what should me set as changed in the other record? What about the revision history?
We were thinking that it should only update its āparentsā records (records that have a linked content to it).
For us it donāt need to appear in the revision history of the parents page, because its changes are not directly visibles on the parent page.
But from an architectural view, if we fetch the PostRecord
and all its fields (including the linked AuthorRecord
field) from the GraphQL API, the data will be actually different if we change some of the authorās info. So, I think, that the updatedAt
should reflect that and it would tell us that the data we just got are newer.
I think you should fetch all the published/updated at timestamps and use the most recent to invalidate the cache. You are fetching all the content anyway, right?
No, we donāt fetch all the contents of each page record.
We have a lot of pages and when we need to build the site itās 99% of the time because only one page changed. So to not make long queries for nothing, we only fetch the publishedAt
of each page and if itās newer, then we fetch all its content.
We have a lot of modules (linked model) on each page, so weāll need to check all the publisheAt
of all the linked content of each page ?
This is what weāre doing on the first call:
allLandings {
_publishedAt
// ... locale stuff
}
And if I understand correctly, weāll need to do that ? :
allLandings {
_publishedAt
hero {
... on LandingHeroFormRecord {
_publishedAt
form{
formLines {
formLine {
...on InputRecord {
_publishedAt
}
...on InputHiddenRecord {
_publishedAt
}
...on SelectRecord {
_publishedAt
}
...on GroupsSelectRecord {
_publishedAt
optionsGroups {
...on OptionGroupRecord {
_publishedAt
}
}
}
...on TextareaRecord {
_publishedAt
}
}
}
}
}
... on LandingHeroVideoRecord {
_publishedAt
}
... on LandingHeroImageRecord {
_publishedAt
}
... on LandingHeroIllustrationRecord {
_publishedAt
}
}
// ... locale stuff
}
And this is only one module (hero) for only one page type (landing). We have around 10 different page type and each as around 40 different modules. Without even counting the nested linked contents (like in the form
field above)
To us it seems to be a lot of things to do to only check if the page data have changed. Itās not scalable either, we would have to change this query every time we add a linked content anywhere in the tree.
Sorry about the amount of text 
But, again, this is critical to do incremental builds on DatoCMS. We think, more and more JAMSTACK developers will need incremental builds, thatās why I explained a lot of our process here, if it can help other people.
A _dataChangedAt
field in the API might be the best option.
Anyway, maybe weāre doing it all wrong !
Do you think of someway else ?
Thanks a lot !