Skip to content

feat: add locale override parameter to client.fetch#2361

Closed
matthewvolk wants to merge 1 commit into
canaryfrom
CATALYST-1134-add-locale-param-to-client
Closed

feat: add locale override parameter to client.fetch#2361
matthewvolk wants to merge 1 commit into
canaryfrom
CATALYST-1134-add-locale-param-to-client

Conversation

@matthewvolk

Copy link
Copy Markdown
Contributor

What/Why?

Allows passing a locale that will be used to set the outgoing "Accept-Language" header sent to the BigCommerce Storefront GraphQL API. This additional, optional parameter gives you more explicit control over what language you'd like responses to be translated into, leveraging BigCommerce's resolved locale feature.

Note

This PR originated from #2286

Testing

N/A - Additive change

Migration

  • For those consuming the package from the NPM registry, this feature will be available in version 0.16 or higher, so a simple version bump should suffice.
  • For those using the package via pnpm workspaces, simply cherry-pick the additive diff from this PR into your branch.

@matthewvolk
matthewvolk requested a review from a team June 3, 2025 16:27
@changeset-bot

changeset-bot Bot commented Jun 3, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e1ad83

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@bigcommerce/catalyst-client Minor
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel

vercel Bot commented Jun 3, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-canary ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2025 4:45pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
catalyst ⬜️ Ignored (Inspect) Jun 3, 2025 4:45pm
catalyst-au ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2025 4:45pm
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2025 4:45pm

Allows passing a `locale` that will be used to set the outgoing
`"Accept-Language"` header sent to the BigCommerce Storefront GraphQL
API
@matthewvolk
matthewvolk force-pushed the CATALYST-1134-add-locale-param-to-client branch from fc0091c to 9e1ad83 Compare June 3, 2025 16:43
@matthewvolk
matthewvolk marked this pull request as draft June 3, 2025 18:42
@matthewvolk

Copy link
Copy Markdown
Contributor Author

Converted to draft; discussed with the team, and we should either more appropriately name this parameter based on what it is actually doing (overriding Accept-Language header), or find a way to deliver #2286 without a change to the client. Going to think a bit on the best path forward, but don't want to give the impression this PR is final.

@matthewvolk

Copy link
Copy Markdown
Contributor Author

I'm going to go the route of not modifying the client. Feels aggressive to extend the client's API just for the one case needed in #2286

@matthewvolk matthewvolk closed this Jun 3, 2025
@matthewvolk
matthewvolk deleted the CATALYST-1134-add-locale-param-to-client branch June 20, 2025 17:28
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.

1 participant