Skip to content

feat: add integration for locale based publishing in CDA [TOL-3653]#2649

Open
MayaGillilan wants to merge 3 commits intomasterfrom
TOL-3653
Open

feat: add integration for locale based publishing in CDA [TOL-3653]#2649
MayaGillilan wants to merge 3 commits intomasterfrom
TOL-3653

Conversation

@MayaGillilan
Copy link

@MayaGillilan MayaGillilan commented Mar 10, 2026

Summary

Adds integration via optional modifier to pass X-Contentful-Locale-Based-Publishing header in entry and asset rquests.

Description

Adds optional modifier withLocaleBasedPublishing
When added, passes X-Contentful-Locale-Based-Publishing header in entry and asset requests
Adds tests for the above

Motivation and Context

https://contentful.atlassian.net/browse/TOL-3653

PR Checklist

  • I have read the CONTRIBUTING.md file
  • All commits follow conventional commits
  • Documentation is updated (if necessary)
  • PR doesn't contain any sensitive information
  • There are no breaking changes
  • CDA integration is deployed & ready

@ethan-ozelius-contentful
Copy link
Contributor

ethan ozelius (ethan-ozelius-contentful) commented Mar 10, 2026

I have a general question about the decision to use chain modifiers instead of something like a option/query param, is this intentional? Is there a reason that it can't be accomplished with a option/query param?

The reason I ask is that I had to look up how chain modifiers work in the CDA, and it isn't very well documented (unless I'm missing something). The only reference I was able to find to it was in this typescript tutorial.

I'll raise this question to the rest of the team to see if anyone else has any insights/opinions but I was just curious. My initial reaction is that this feels like an option that could be passed to the 2 methods that expect it:

const allEntries = await client.getEntries({
  // for what it's worth, locale is an option at this level, so withLocaleBasedPublishing doesn't feel far off.
  localeBasedPublishing: true,
  // or maybe even add it to query? 
  query: {
    localeBasedPublishing: true,
  }
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ethan-ozelius-contentful
Copy link
Contributor

I have a general question about the decision to use chain modifiers instead of something like a option/query param, is this intentional? Is there a reason that it can't be accomplished with a option/query param?

The reason I ask is that I had to look up how chain modifiers work in the CDA, and it isn't very well documented (unless I'm missing something). The only reference I was able to find to it was in this typescript tutorial.

I'll raise this question to the rest of the team to see if anyone else has any insights/opinions but I was just curious. My initial reaction is that this feels like an option that could be passed to the 2 methods that expect it:

const allEntries = await client.getEntries({
  // for what it's worth, locale is an option at this level, so withLocaleBasedPublishing doesn't feel far off.
  localeBasedPublishing: true,
  // or maybe even add it to query? 
  query: {
    localeBasedPublishing: true,
  }
})

Raised this with the rest of the DX team and using chain modifiers makes a lot of sense given the existing chain modifiers. A new section in the CDA developer docs on how to use chain modifiers would be nice, but is out of scope for this PR.

I'll give this an approval, thanks for the improvement.

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.

4 participants