diff --git a/CHANGELOG.md b/CHANGELOG.md index a72848d..0603416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- `priceToken` (signed price, Pricing Fallback V2) requested on the product query through the new opt-in `PriceTokenFragment`, exposing data from `vtex.search-graphql@0.72.0` / `vtex.search-resolver@1.106.0` so storefront apps can forward it on add to cart. + ## [0.106.0] - 2026-05-26 ### Added diff --git a/react/fragments/priceToken.graphql b/react/fragments/priceToken.graphql new file mode 100644 index 0000000..f4fcf97 --- /dev/null +++ b/react/fragments/priceToken.graphql @@ -0,0 +1,10 @@ +# Signed price (Pricing Fallback V2), exposed by `vtex.search-graphql` >= 0.72.0. +# +# Kept apart from CommertialOfferFragment on purpose: that fragment is also +# spread into recommendationShelf.gql, whose provider +# (`vtex.recommendation-graphql`) declares its own `Offer` type, without this +# field - adding it there would invalidate that whole document. Queries opt in +# by spreading this fragment, so each provider only gets what it can resolve. +fragment PriceTokenFragment on Offer { + priceToken +} diff --git a/react/queries/product.gql b/react/queries/product.gql index 2d9a568..14e6d47 100644 --- a/react/queries/product.gql +++ b/react/queries/product.gql @@ -3,6 +3,7 @@ #import '../fragments/seller.graphql' #import '../fragments/commertialOffer.graphql' #import '../fragments/installment.graphql' +#import '../fragments/priceToken.graphql' query Product( $slug: String @@ -31,6 +32,7 @@ query Product( sellerDefault commertialOffer { ...CommertialOfferFragment + ...PriceTokenFragment CacheVersionUsedToCallCheckout Installments { ...InstallmentFragment