Repository navigation
fix(api): correct item videos field casing - #3447
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe exported VTEX ChangesVTEX search result type compatibility
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized type correction aligns the item video field with the lowercase payload shape while preserving its string array type; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
@evander-corebiz Thanks for tracking this down — the type/payload mismatch is real (confirmed One concern with the rename as-is: Item is explicitly re-exported from To avoid a breaking change here, I'm suggesting an alternative here: add the correct field instead of renaming, and deprecate the old one. The old field can be removed cleanly in a future major version with its own BREAKING CHANGE: note. Does this approach work for you? |
…archResult.ts Co-authored-by: Fanny Chien <[email protected]>
Yes, I think so. The idea is to be able to use the native type on auto complete and it not break the validations. I apllied the changes. Thanks! |
|
## What's the purpose of this pull request? The `Item` type in the VTEX Search API client declares the video field as `Videos`, but the FastStore GraphQL search response returns it as `videos`. This mismatch makes the internal TypeScript type inconsistent with the actual payload and may cause incorrect property access for SKU videos. This PR updates the field casing while preserving its existing `string[]` type. ## How it works? The `Item` interface now declares the field as: ```ts videos: string[] ``` No runtime behavior or public GraphQL schema was changed. ## How to test it? * Confirm that `ProductSearchResult.Item` exposes `videos` as `string[]`. * Run the Biome validation: ```bash pnpm exec biome check packages/api/src/platforms/vtex/clients/search/types/ProductSearchResult.ts ``` * Validate the diff: ```bash git diff --check ``` Both checks should pass. ### Starters Deploy Preview Not applicable. This is a type-only change with no storefront UI or runtime behavior changes. ## References * [[VTEX Search GraphQL documentation](https://developers.vtex.com/docs/apps/vtex.search-graphql)](https://developers.vtex.com/docs/apps/vtex.search-graphql) * [[VTEX product search response example](https://developers.vtex.com/docs/guides/consult-product-search-information)](https://developers.vtex.com/docs/guides/consult-product-search-information) * Actual FastStore search fixtures already use `videos` in lowercase. ## Checklist <em>You may erase this after checking them all 😉</em> **PR Title and Commit Messages** * [x] PR title and commit messages follow the [[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)](https://www.conventionalcommits.org/en/v1.0.0/) specification * Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `ci` and `test` * Prefix used: `fix` * Scope used: `api` **PR Description** * [x] Added a label according to the PR goal - `breaking change`, `bug`, `contributing`, `performance`, `documentation`.. * Label used: `bug` **Dependencies** * [x] Committed the `pnpm-lock.yaml` file when there were changes to the packages * No dependencies or package versions were changed, so `pnpm-lock.yaml` was not modified. **Documentation** * [x] PR description * [x] For documentation changes, ping `@Mariana-Caetano` to review and update (Or submit a doc request) * Not applicable. This PR only corrects an internal TypeScript type. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **Bug Fixes** * Improved compatibility for product video data in search results by retaining support for the deprecated `Videos` property alongside `videos`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Evander Oliveira <[email protected]> Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Fanny Chien <[email protected]>

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (35.60% Estimated after merge)
What's the purpose of this pull request?
The
Itemtype in the VTEX Search API client declares the video field asVideos, but the FastStore GraphQL search response returns it asvideos.This mismatch makes the internal TypeScript type inconsistent with the actual payload and may cause incorrect property access for SKU videos.
This PR updates the field casing while preserving its existing
string[]type.How it works?
The
Iteminterface now declares the field as:No runtime behavior or public GraphQL schema was changed.
How to test it?
ProductSearchResult.Itemexposesvideosasstring[].pnpm exec biome check packages/api/src/platforms/vtex/clients/search/types/ProductSearchResult.tsBoth checks should pass.
Starters Deploy Preview
Not applicable. This is a type-only change with no storefront UI or runtime behavior changes.
References
videosin lowercase.Checklist
You may erase this after checking them all 😉
PR Title and Commit Messages
PR title and commit messages follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
feat,fix,chore,docs,style,refactor,ciandtestfixapiPR Description
Added a label according to the PR goal -
breaking change,bug,contributing,performance,documentation..bugDependencies
Committed the
pnpm-lock.yamlfile when there were changes to the packagespnpm-lock.yamlwas not modified.Documentation
PR description
For documentation changes, ping
@Mariana-Caetanoto review and update (Or submit a doc request)Summary by CodeRabbit
Summary by CodeRabbit
Videosproperty alongsidevideos.