bug(gatsby-source-strapi): cache is not invalidated when nested relations have newer updatedAt/publishedAt
- Dominant language
- JavaScript
- Stars
- 57
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the bug
`gatsby-source-strapi` does not invalidate Gatsby cache when a nested relation is updated more recently than its parent entity.
## To Reproduce
Steps to reproduce the behavior:
1. Create two collections in Strapi with a one-to-many relation and add some data.
2. Source content from Strapi using gatsby-source-strapi.
```
{
singularName: "testParentThing",
queryParams: {
fields: "*",
populate: {
testChildThings: {
fields: "*",
},
},
},
}
```
3. Update only the nested related item.
4. Run Gatsby again with cache/incremental behavior in place.
5. Observe that the parent Gatsby node is not considered changed.
## Expected behavior
The Gatby caching mechanism should inspect the updatedAt and publishedAt dates in all nested relations to determine if the cache is expired.
## System Info
- Run: `yarn gatsby info --clipboard` in your project directory
```
System:
OS: macOS 15.7.3
CPU: (11) arm64 Apple M3 Pro
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.19.0 -
/private/var/folders/h1/2z_zmztd0cbcw40g4tt_wdk80000gn/T/xfs-9ae50c76/node
Yarn: 4.9.2 -
/private/var/folders/h1/2z_zmztd0cbcw40g4tt_wdk80000gn/T/xfs-9ae50c76/yarn
npm: 10.2.3 - /Users/michaelolund/.nvm/versions/node/v18.19.0/bin/npm
Browsers:
Chrome: 145.0.7632.160
Safari: 26.1
```
- Provide a link to a repository if it is publicly available: https://github.com/bcgov/bcparks.ca/blob/main/src/gatsby/gatsby-config.js
Contributor guide
Assessment
This issue has not been assessed yet.