Skip to content

Conversation

@cjphs
Copy link

@cjphs cjphs commented Dec 2, 2025

Description

The linked issue seems to occur because, in Strapi, localized entries share the same documentId, so localized entries override each other when the plugin sources them from Strapi. This is fixed by providing entry.locale (if present) to the createNodeId call.

Additionally, this pull request also fixes the handling of locale=all in queries. For collection types, it appears that locale=* still works to fetch all entries of all localizations in Strapi v5, so I stuck with that for now...

I have tested this in my application with Strapi v4 & v5, both compiling without problems. I have not tested the new code for an application not using i18 though.

Documentation

https://github.com/gatsby-uc/plugins/blob/main/packages/gatsby-source-strapi/README.md#internationalization This documentation should likely change... please correct me if I overlooked something, but there are no mentions of Strapi v5's breaking changes here. Was a bit confusing, maybe that should be amended in the meantime until these changes are merged?

Anyway, I don't think this documentation needs to change for now, with my changes in mind.

Related Issues

Fixes #509

@changeset-bot
Copy link

changeset-bot bot commented Dec 2, 2025

⚠️ No Changeset found

Latest commit: a7b577c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@SylvainGibert
Copy link

I am interested with it !

@laurenskling
Copy link
Contributor

laurenskling commented Dec 16, 2025

I suggest you and @SylvainGibert work together on this (#521). This needs extensive edge case testing, also for non-i18n setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(gatsby-source-strapi): When locale: "all" is used in a singleTypes error is thrown on a startup

3 participants