Repository navigation
Queries | Add ProductClutersIds to summary fragment - #630
Merged
Merged
Conversation
emersonlaurentino
approved these changes
Apr 14, 2021
tlgimenes
force-pushed
the
feature/product-queryes
branch
from
April 14, 2021 15:00
05cbb26 to
1d3c061
Compare
4 tasks done
eduardoformiga
added a commit
that referenced
this pull request
Sep 29, 2026
## What's the purpose of this pull request?
VTEX Intelligent Search v1 returns `productClusters` for each catalog
product, and the FastStore VTEX client already receives that data.
However, the FastStore GraphQL schema does not expose it, so storefronts
cannot read product-cluster membership on PDPs, product cards, or
shelves without an API extension or an additional REST request.
This restores access to product cluster IDs and names through the
normalized FastStore product model.
## How it works
- Adds `StoreProductCluster` with `id` and `name`.
- Adds `productClusters: [StoreProductCluster!]!` to
`StoreProductGroup`, since VTEX product clusters belong to the catalog
product rather than an individual SKU.
- Passes the Intelligent Search response through the `StoreProductGroup`
resolver and returns an empty list when the field is absent.
- Corrects the Intelligent Search client type from a record to the
documented `[{ id, name }]` response shape.
- Regenerates API and Core GraphQL types.
- Adds schema and resolver regression coverage.
Storefront queries can request:
```graphql
isVariantOf {
productClusters {
id
name
}
}
```
This is an additive GraphQL schema change.
## How to test it?
- `pnpm --filter @faststore/api test`
- 305 unit tests passed
- 56 integration tests passed
- `pnpm --filter @faststore/api build`
- `pnpm --filter @faststore/core gen-types`
- `pnpm exec biome check <changed files>`
## References
- [VTEX Intelligent Search API v1 response
schema](https://github.com/vtex/openapi-schemas/blob/master/VTEX%20-%20Intelligent%20Search%20API%20-%20v1.json#L1926-L1942)
- [FastStore Intelligent Search response
type](https://github.com/vtex/faststore/blob/dev/packages/api/src/platforms/vtex/clients/search/types/ProductSearchResult.ts#L71-L83)
- [Historical FastStore productClusters
support](#630)
## Checklist
- [x] PR title and commit follow Conventional Commits.
- [x] Tests and build pass.
- [x] Generated GraphQL types are included.
- [x] No dependency or lockfile changes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Product groups now expose product cluster IDs and names through the
API, returning an empty list when no clusters are available.
- **Tests**
- Added coverage for product cluster data and its handling when absent.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: eduardoformiga <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the purpose of this pull request?
Considering the context, what is the problem we'll solve? Where in VTEX's big picture our issue fits in? Write a tweet about the context and the problem itself.
How it works?
Tell us the role of the new feature, or component, in its context.
How to test it?
carrefourbrfood
btglobal
marinbrasil
storecomponents
References
Spread the knowledge: is there any content you used to create this PR that is worth sharing?
Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process