Repository navigation
Resolve categoryTree via catalog-dataplane instead of per-category calls - #612
Conversation
Product.categoryTree walked the category tree one HTTP call per level
(search.category). Replace it with a single call to the catalog-dataplane
product endpoint via JanusClient (portal.vtexcommerce{stable,beta}.com.br),
which already returns the full root-to-leaf category path for the product.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
The dataplane product category path already returns localized name, title, and meta, so wrapping them for @translatableV2 would re-translate those strings. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Your PR has been merged! App is being published. 🚀 After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:
After that your app will be updated on all accounts. For more information on the deployment process check the docs. 📖 |
Description
This change is directly related to the Multilanguage feature. We are updating the CategoryTree resolver to use the new catalog client (catalog-dataplane) to get the already translated data.
The
catalog-dataplaneindexes both translations (from multilanguage and messages api). Once the request comes, it delivers an already translated response.This PR has two big parts.
Companion graphql: vtex-apps/search-graphql#175. Publish both apps together. (search-resolver should be executed first)
Summary
GET /api/catalog-dataplane/product/{id}), which already returns the product's full root-to-leaf category path in one response.CatalogDataplaneclient extendsJanusClient(same base asCheckout/Intsch), hittingportal.vtexcommerce{stable,beta}.com.brwithan={account}— no session/user auth header is sent, only the platform's own outbound-accessProxy-Authorization, keeping the request cache-friendly.Categoryname,titleTag, andmetaTagDescriptionwithformatTranslatableProp. Catalog-dataplane already returns these strings localized; Messages wrapping would re-translate them. This restores the behavior from [CATS-4817] Return Category fields from catalog without Messages wrapping #608 (yanked in 1.115.0 because the previous catalog route did not own translation).logDegradedSearchErrorand returns[](no fallback to the old per-ID calls, to avoid mixing two data sources for the same field).Test plan
An account with multilanguage active should have the translation of the categoryTree fixed, while the account that uses messages should be transparent.
biscoinduses messages; production should be equal to the linked workspacekohlerqauses multilanguage; production should always show EN, while the linked workspaces should have the behavior fixed