Skip to content

Queries | Add ProductClutersIds to summary fragment - #630

Merged
tlgimenes merged 8 commits into
masterfrom
feature/product-queryes
Apr 14, 2021
Merged

tlgimenes merged 8 commits into
masterfrom
feature/product-queryes

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Apr 14, 2021 •

Copy link
Copy Markdown
Contributor

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

@tlgimenes
tlgimenes requested a review from a team as a code owner April 14, 2021 14:24
@tlgimenes
tlgimenes force-pushed the feature/product-queryes branch from 05cbb26 to 1d3c061 Compare April 14, 2021 15:00
@tlgimenes
tlgimenes merged commit ae97579 into master Apr 14, 2021
@tlgimenes
tlgimenes deleted the feature/product-queryes branch April 14, 2021 19:10
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]>
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.

3 participants