Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds product search query without simulation #73

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- new `productSearchNoSimulations` query

## [0.37.1] - 2019-11-12
### Added
Expand Down
2 changes: 2 additions & 0 deletions react/Queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import address from './queries/address.gql'
import searchMetadata from './queries/searchMetadata.gql'
import productCategoryTree from './queries/UNSTABLE__productCategoryTree.gql'
import facets from './queries/facets.gql'
import productSearchNoSimulations from './queries/productSearchNoSimulations.gql'

export default {
address,
Expand All @@ -26,4 +27,5 @@ export default {
UNSTABLE__productCategoryTree: productCategoryTree,
searchMetadata,
facets,
productSearchNoSimulations
}
116 changes: 116 additions & 0 deletions react/queries/productSearchNoSimulations.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
query productSearchNoSimulations(
$query: String
$map: String
$orderBy: String
$priceRange: String
$from: Int
$to: Int
$hideUnavailableItems: Boolean = false
$skusFilter: ItemsFilter = ALL_AVAILABLE
) {
productSearchNoSimulations(
query: $query
map: $map
orderBy: $orderBy
priceRange: $priceRange
from: $from
to: $to
jgfidelis marked this conversation as resolved.
Show resolved Hide resolved
hideUnavailableItems: $hideUnavailableItems
) @context(provider: "vtex.search-graphql") {
products {
productId
description
productName
productReference
linkText
brand
brandId
link
categories
specificationGroups {
name
specifications {
name
values
}
}
items(filter: $skusFilter) {
itemId
name
nameComplete
complementName
ean
variations {
name
values
}
referenceId {
Key
Value
}
measurementUnit
unitMultiplier
images {
cacheId
imageId
imageLabel
imageTag
imageUrl
imageText
}
sellers {
sellerId
sellerName
commertialOffer {
skippedSimulation
discountHighlights {
name
}
teasers {
name
conditions {
minimumQuantity
parameters {
name
value
}
}
effects {
parameters {
name
value
}
}
}
Installments(criteria: MAX) {
Value
InterestRate
TotalValuePlusInterestRate
NumberOfInstallments
Name
}
Price
ListPrice
PriceWithoutDiscount
RewardValue
PriceValidUntil
AvailableQuantity
}
}
}
productClusters {
id
name
}
properties {
name
values
}
}
recordsFiltered
breadcrumb {
name
href
}
}
}
4 changes: 3 additions & 1 deletion react/queries/productSearchV2.gql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ query productSearchV2(
$withFacets: Boolean = true
$hideUnavailableItems: Boolean = false
$skusFilter: ItemsFilter = ALL_AVAILABLE
$skipBreadcrumb: Boolean = false
) {
productSearch(
query: $query
Expand Down Expand Up @@ -82,6 +83,7 @@ query productSearchV2(
sellerId
sellerName
commertialOffer {
skippedSimulation
discountHighlights {
name
}
Expand Down Expand Up @@ -127,7 +129,7 @@ query productSearchV2(
}
}
recordsFiltered
breadcrumb {
breadcrumb @skip(if: $skipBreadcrumb) {
name
href
}
Expand Down