Skip to content

bug(gatsby-source-strapi): cache is not invalidated when nested relations have newer updatedAt/publishedAt #523

Description

@molund

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: "*",
      },
    },
  },
}
  1. Update only the nested related item.
  2. Run Gatsby again with cache/incremental behavior in place.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions