@faststore/api 1.8.38 → 1.8.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/__generated__/schema.d.ts +10 -2
- package/dist/api.cjs.development.js +10 -4
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +10 -4
- package/dist/api.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/__generated__/schema.ts +11 -2
- package/src/platforms/vtex/resolvers/searchResult.ts +5 -2
- package/src/typeDefs/query.graphql +16 -2
|
@@ -552,11 +552,20 @@ export const enum StoreStatus {
|
|
|
552
552
|
Warning = 'WARNING'
|
|
553
553
|
};
|
|
554
554
|
|
|
555
|
+
/** Suggestion term. */
|
|
556
|
+
export type StoreSuggestionTerm = {
|
|
557
|
+
__typename?: 'StoreSuggestionTerm';
|
|
558
|
+
/** Its occurrences count. */
|
|
559
|
+
count: Scalars['Int'];
|
|
560
|
+
/** The term. */
|
|
561
|
+
value: Scalars['String'];
|
|
562
|
+
};
|
|
563
|
+
|
|
555
564
|
/** Suggestions information. */
|
|
556
565
|
export type StoreSuggestions = {
|
|
557
566
|
__typename?: 'StoreSuggestions';
|
|
558
567
|
/** Array with suggestion products' information. */
|
|
559
|
-
products
|
|
568
|
+
products: Array<StoreProduct>;
|
|
560
569
|
/** Array with suggestion terms. */
|
|
561
|
-
terms
|
|
570
|
+
terms: Array<StoreSuggestionTerm>;
|
|
562
571
|
};
|
|
@@ -18,7 +18,10 @@ export const StoreSearchResult: Record<string, Resolver<Root>> = {
|
|
|
18
18
|
const topSearches = await search.topSearches()
|
|
19
19
|
|
|
20
20
|
return {
|
|
21
|
-
terms: topSearches.searches.map((item) =>
|
|
21
|
+
terms: topSearches.searches.map((item) => ({
|
|
22
|
+
value: item.term,
|
|
23
|
+
count: item.count,
|
|
24
|
+
})),
|
|
22
25
|
products: [],
|
|
23
26
|
}
|
|
24
27
|
}
|
|
@@ -37,7 +40,7 @@ export const StoreSearchResult: Record<string, Resolver<Root>> = {
|
|
|
37
40
|
const { searches } = terms
|
|
38
41
|
|
|
39
42
|
return {
|
|
40
|
-
terms: searches.map((item) => item.term),
|
|
43
|
+
terms: searches.map((item) => ({ value: item.term, count: item.count })),
|
|
41
44
|
products: skus,
|
|
42
45
|
}
|
|
43
46
|
},
|
|
@@ -84,6 +84,20 @@ enum StoreFacetType {
|
|
|
84
84
|
RANGE
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
"""
|
|
88
|
+
Suggestion term.
|
|
89
|
+
"""
|
|
90
|
+
type StoreSuggestionTerm {
|
|
91
|
+
"""
|
|
92
|
+
The term.
|
|
93
|
+
"""
|
|
94
|
+
value: String!
|
|
95
|
+
"""
|
|
96
|
+
Its occurrences count.
|
|
97
|
+
"""
|
|
98
|
+
count: Int!
|
|
99
|
+
}
|
|
100
|
+
|
|
87
101
|
"""
|
|
88
102
|
Suggestions information.
|
|
89
103
|
"""
|
|
@@ -91,11 +105,11 @@ type StoreSuggestions {
|
|
|
91
105
|
"""
|
|
92
106
|
Array with suggestion terms.
|
|
93
107
|
"""
|
|
94
|
-
terms: [
|
|
108
|
+
terms: [StoreSuggestionTerm!]!
|
|
95
109
|
"""
|
|
96
110
|
Array with suggestion products' information.
|
|
97
111
|
"""
|
|
98
|
-
products: [StoreProduct!]
|
|
112
|
+
products: [StoreProduct!]!
|
|
99
113
|
}
|
|
100
114
|
|
|
101
115
|
"""
|