@faststore/api 1.10.30 → 1.11.3

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/dist/api.esm.js CHANGED
@@ -591,8 +591,10 @@ function slugify(str) {
591
591
 
592
592
  const isBrand = x => x.type === 'brand' || isCollectionPageType(x) && x.pageType.toLowerCase() === 'brand';
593
593
 
594
+ const isCollection = x => isCollectionPageType(x) && x.pageType.toLowerCase() === 'collection';
595
+
594
596
  const slugifyRoot = root => {
595
- if (isBrand(root)) {
597
+ if (isBrand(root) || isCollection(root)) {
596
598
  return slugify(root.name);
597
599
  }
598
600
 
@@ -927,7 +929,7 @@ const isAttachment = value => value.valueReference === VALUE_REFERENCES.attachme
927
929
  const getId = item => {
928
930
  var _item$itemOffered$add;
929
931
 
930
- return [item.itemOffered.sku, item.seller.identifier, item.price, (_item$itemOffered$add = item.itemOffered.additionalProperty) == null ? void 0 : _item$itemOffered$add.filter(isAttachment).map(getPropertyId).join('-')].filter(Boolean).join('::');
932
+ return [item.itemOffered.sku, item.seller.identifier, item.price < 0.01 ? 'Gift' : undefined, (_item$itemOffered$add = item.itemOffered.additionalProperty) == null ? void 0 : _item$itemOffered$add.filter(isAttachment).map(getPropertyId).join('-')].filter(Boolean).join('::');
931
933
  };
932
934
 
933
935
  const orderFormItemToOffer = (item, index) => ({
@@ -965,7 +967,12 @@ const groupById = offers => offers.reduce((acc, item) => {
965
967
  var _acc$get;
966
968
 
967
969
  const id = getId(item);
968
- acc.set(id, (_acc$get = acc.get(id)) != null ? _acc$get : item);
970
+
971
+ if (!acc.has(id)) {
972
+ acc.set(id, []);
973
+ }
974
+
975
+ (_acc$get = acc.get(id)) == null ? void 0 : _acc$get.push(item);
969
976
  return acc;
970
977
  }, new Map());
971
978
 
@@ -984,6 +991,30 @@ const equals = (storeOrder, orderForm) => {
984
991
  return isSameOrder && orderItemsAreSync;
985
992
  };
986
993
 
994
+ const joinItems = form => {
995
+ const itemsById = form.items.reduce((acc, item) => {
996
+ const id = getId(orderFormItemToOffer(item));
997
+
998
+ if (!acc[id]) {
999
+ acc[id] = [];
1000
+ }
1001
+
1002
+ acc[id].push(item);
1003
+ return acc;
1004
+ }, {});
1005
+ return { ...form,
1006
+ items: Object.values(itemsById).map(items => {
1007
+ const [item] = items;
1008
+ const quantity = items.reduce((acc, i) => acc + i.quantity, 0);
1009
+ const totalPrice = items.reduce((acc, i) => acc + i.quantity * i.sellingPrice, 0);
1010
+ return { ...item,
1011
+ quantity,
1012
+ sellingPrice: totalPrice / quantity
1013
+ };
1014
+ })
1015
+ };
1016
+ };
1017
+
987
1018
  const orderFormToCart = async (form, skuLoader) => {
988
1019
  return {
989
1020
  order: {
@@ -1086,7 +1117,7 @@ const validateCart = async (_, {
1086
1117
  const isStale = isOrderFormStale(orderForm);
1087
1118
 
1088
1119
  if (isStale === true && orderNumber) {
1089
- const newOrderForm = await setOrderFormEtag(orderForm, commerce);
1120
+ const newOrderForm = await setOrderFormEtag(orderForm, commerce).then(joinItems);
1090
1121
  return orderFormToCart(newOrderForm, skuLoader);
1091
1122
  }
1092
1123
  } // Step2: Process items from both browser and checkout so they have the same shape
@@ -1094,33 +1125,41 @@ const validateCart = async (_, {
1094
1125
 
1095
1126
  const browserItemsById = groupById(acceptedOffer);
1096
1127
  const originItemsById = groupById(orderForm.items.map(orderFormItemToOffer));
1097
- const browserItems = Array.from(browserItemsById.values()); // items on the user's browser
1128
+ const originItems = Array.from(originItemsById.entries()); // items on the VTEX platform backend
1098
1129
 
1099
- const originItems = Array.from(originItemsById.values()); // items on the VTEX platform backend
1130
+ const browserItems = Array.from(browserItemsById.entries()); // items on the user's browser
1100
1131
  // Step3: Compute delta changes
1101
1132
 
1102
1133
  const {
1103
1134
  itemsToAdd,
1104
1135
  itemsToUpdate
1105
- } = browserItems.reduce((acc, item) => {
1106
- const maybeOriginItem = originItemsById.get(getId(item));
1136
+ } = browserItems.reduce((acc, [id, items]) => {
1137
+ const maybeOriginItem = originItemsById.get(id); // Adding new items to cart
1107
1138
 
1108
1139
  if (!maybeOriginItem) {
1109
- acc.itemsToAdd.push(item);
1110
- } else {
1111
- acc.itemsToUpdate.push({ ...maybeOriginItem,
1112
- quantity: item.quantity
1113
- });
1114
- }
1140
+ items.forEach(item => acc.itemsToAdd.push(item));
1141
+ return acc;
1142
+ } // Update existing items
1143
+
1144
+
1145
+ const [head, ...tail] = maybeOriginItem;
1146
+ const totalQuantity = items.reduce((acc, curr) => acc + curr.quantity, 0); // set total quantity to first item
1115
1147
 
1148
+ acc.itemsToUpdate.push({ ...head,
1149
+ quantity: totalQuantity
1150
+ }); // Remove all the rest
1151
+
1152
+ tail.forEach(item => acc.itemsToUpdate.push({ ...item,
1153
+ quantity: 0
1154
+ }));
1116
1155
  return acc;
1117
1156
  }, {
1118
1157
  itemsToAdd: [],
1119
1158
  itemsToUpdate: []
1120
1159
  });
1121
- const itemsToDelete = originItems.filter(item => !browserItemsById.has(getId(item))).map(item => ({ ...item,
1160
+ const itemsToDelete = originItems.filter(([id]) => !browserItemsById.has(id)).flatMap(([, items]) => items.map(item => ({ ...item,
1122
1161
  quantity: 0
1123
- }));
1162
+ })));
1124
1163
  const changes = [...itemsToAdd, ...itemsToUpdate, ...itemsToDelete].map(offerToOrderItemInput);
1125
1164
 
1126
1165
  if (changes.length === 0) {
@@ -1133,7 +1172,7 @@ const validateCart = async (_, {
1133
1172
  id: orderForm.orderFormId,
1134
1173
  orderItems: changes
1135
1174
  }) // update orderForm etag so we know last time we touched this orderForm
1136
- .then(form => enableOrderFormSync ? setOrderFormEtag(form, commerce) : form); // Step5: If no changes detected before/after updating orderForm, the order is validated
1175
+ .then(form => enableOrderFormSync ? setOrderFormEtag(form, commerce) : form).then(joinItems); // Step5: If no changes detected before/after updating orderForm, the order is validated
1137
1176
 
1138
1177
  if (equals(order, updatedOrderForm)) {
1139
1178
  return null;
@@ -1501,15 +1540,14 @@ const StoreProductGroup = {
1501
1540
  productGroupID: ({
1502
1541
  isVariantOf
1503
1542
  }) => isVariantOf.productId,
1504
- name: ({
1505
- isVariantOf
1506
- }) => isVariantOf.productName,
1543
+ name: root => root.isVariantOf.productName,
1544
+ skuVariants: root => root,
1507
1545
  additionalProperty: ({
1508
1546
  isVariantOf: {
1509
1547
  specificationGroups
1510
1548
  }
1511
- }) => specificationGroups // filter sku specifications so we dont mess sku with product specs
1512
- .filter(specificationGroup => !BLOCKED_SPECIFICATIONS.has(specificationGroup.name)) // Transform specs back into product specs
1549
+ }) => specificationGroups // Filter sku specifications so we don't mix them with product specs.
1550
+ .filter(specificationGroup => !BLOCKED_SPECIFICATIONS.has(specificationGroup.name)) // Transform specs back into product specs.
1513
1551
  .flatMap(({
1514
1552
  specifications
1515
1553
  }) => specifications.flatMap(({
@@ -1894,6 +1932,188 @@ const StoreSeo = {
1894
1932
  titleTemplate: () => ''
1895
1933
  };
1896
1934
 
1935
+ function findSkuVariantImage(availableImages) {
1936
+ var _availableImages$find;
1937
+
1938
+ return (_availableImages$find = availableImages.find(imageProperties => imageProperties.imageLabel === 'skuvariation')) != null ? _availableImages$find : availableImages[0];
1939
+ }
1940
+
1941
+ function createSlugsMap(variants, dominantVariantName, baseSlug) {
1942
+ /**
1943
+ * Maps property value combinations to their respective SKU's slug. Enables
1944
+ * us to retrieve the slug for the SKU that matches the currently selected
1945
+ * variations in O(1) time.
1946
+ *
1947
+ * Example: `'Color-Red-Size-40': 'classic-shoes-37'`
1948
+ */
1949
+ const slugsMap = {};
1950
+ variants.forEach(variant => {
1951
+ var _skuSpecificationProp, _skuSpecificationProp2;
1952
+
1953
+ const skuSpecificationProperties = variant.variations;
1954
+
1955
+ if (skuSpecificationProperties.length === 0) {
1956
+ return;
1957
+ } // Make sure that the 'name-value' pair for the dominant variation
1958
+ // is always the first one.
1959
+
1960
+
1961
+ const dominantNameValue = `${dominantVariantName}-${(_skuSpecificationProp = (_skuSpecificationProp2 = skuSpecificationProperties.find(variationDetails => variationDetails.name === dominantVariantName)) == null ? void 0 : _skuSpecificationProp2.values[0]) != null ? _skuSpecificationProp : ''}`;
1962
+ const skuVariantKey = skuSpecificationProperties.reduce((acc, property) => {
1963
+ const shouldIgnore = property.name === dominantVariantName;
1964
+
1965
+ if (shouldIgnore) {
1966
+ return acc;
1967
+ }
1968
+
1969
+ return acc + `-${property.name}-${property.values[0]}`;
1970
+ }, dominantNameValue);
1971
+ slugsMap[skuVariantKey] = `${baseSlug}-${variant.itemId}`;
1972
+ });
1973
+ return slugsMap;
1974
+ }
1975
+ function getActiveSkuVariations(variations) {
1976
+ const activeVariations = {};
1977
+ variations.forEach(variation => {
1978
+ activeVariations[variation.name] = variation.values[0];
1979
+ });
1980
+ return activeVariations;
1981
+ }
1982
+ function getVariantsByName(skuSpecifications) {
1983
+ const variants = {};
1984
+ skuSpecifications == null ? void 0 : skuSpecifications.forEach(specification => {
1985
+ var _specification$field$;
1986
+
1987
+ variants[(_specification$field$ = specification.field.originalName) != null ? _specification$field$ : specification.field.name] = specification.values.map(value => {
1988
+ var _value$originalName;
1989
+
1990
+ return (_value$originalName = value.originalName) != null ? _value$originalName : value.name;
1991
+ });
1992
+ });
1993
+ return variants;
1994
+ }
1995
+
1996
+ function compare(a, b) {
1997
+ // Values are always represented as Strings, so we need to handle numbers
1998
+ // in this special case.
1999
+ if (!Number.isNaN(Number(a) - Number(b))) {
2000
+ return Number(a) - Number(b);
2001
+ }
2002
+
2003
+ if (a < b) {
2004
+ return -1;
2005
+ }
2006
+
2007
+ if (a > b) {
2008
+ return 1;
2009
+ }
2010
+
2011
+ return 0;
2012
+ }
2013
+
2014
+ function sortVariants(variantsByName) {
2015
+ const sortedVariants = variantsByName;
2016
+
2017
+ for (const variantProperty in variantsByName) {
2018
+ variantsByName[variantProperty].sort((a, b) => compare(a.value, b.value));
2019
+ }
2020
+
2021
+ return sortedVariants;
2022
+ }
2023
+
2024
+ function getFormattedVariations(variants, dominantVariantName, dominantVariantValue) {
2025
+ /**
2026
+ * SKU options already formatted and indexed by their property name.
2027
+ *
2028
+ * Ex: {
2029
+ * `Size`: [
2030
+ * { label: '42', value: '42' },
2031
+ * { label: '41', value: '41' },
2032
+ * { label: '39', value: '39' },
2033
+ * ]
2034
+ * }
2035
+ */
2036
+ const variantsByName = {};
2037
+ const previouslySeenPropertyValues = new Set();
2038
+ variants.forEach(variant => {
2039
+ if (variant.variations.length === 0) {
2040
+ return;
2041
+ }
2042
+
2043
+ const variantImageToUse = findSkuVariantImage(variant.images);
2044
+ const dominantVariantEntry = variant.variations.find(variation => variation.name === dominantVariantName);
2045
+ const matchesDominantVariant = (dominantVariantEntry == null ? void 0 : dominantVariantEntry.values[0]) === dominantVariantValue;
2046
+
2047
+ if (!matchesDominantVariant) {
2048
+ var _variantImageToUse$im;
2049
+
2050
+ const nameValueIdentifier = `${dominantVariantName}-${dominantVariantEntry == null ? void 0 : dominantVariantEntry.values[0]}`;
2051
+
2052
+ if (!dominantVariantEntry || previouslySeenPropertyValues.has(nameValueIdentifier)) {
2053
+ return;
2054
+ }
2055
+
2056
+ previouslySeenPropertyValues.add(nameValueIdentifier);
2057
+ const formattedVariant = {
2058
+ src: variantImageToUse.imageUrl,
2059
+ alt: (_variantImageToUse$im = variantImageToUse.imageLabel) != null ? _variantImageToUse$im : '',
2060
+ label: `${dominantVariantName}: ${dominantVariantEntry.values[0]}`,
2061
+ value: dominantVariantEntry.values[0]
2062
+ };
2063
+
2064
+ if (variantsByName[dominantVariantEntry.name]) {
2065
+ variantsByName[dominantVariantEntry.name].push(formattedVariant);
2066
+ } else {
2067
+ variantsByName[dominantVariantEntry.name] = [formattedVariant];
2068
+ }
2069
+
2070
+ return;
2071
+ }
2072
+
2073
+ variant.variations.forEach(variationProperty => {
2074
+ var _variantImageToUse$im2;
2075
+
2076
+ const nameValueIdentifier = `${variationProperty.name}-${variationProperty.values[0]}`;
2077
+
2078
+ if (previouslySeenPropertyValues.has(nameValueIdentifier)) {
2079
+ return;
2080
+ }
2081
+
2082
+ previouslySeenPropertyValues.add(nameValueIdentifier);
2083
+ const formattedVariant = {
2084
+ src: variantImageToUse.imageUrl,
2085
+ alt: (_variantImageToUse$im2 = variantImageToUse.imageLabel) != null ? _variantImageToUse$im2 : '',
2086
+ label: `${variationProperty.name}: ${variationProperty.values[0]}`,
2087
+ value: variationProperty.values[0]
2088
+ };
2089
+
2090
+ if (variantsByName[variationProperty.name]) {
2091
+ variantsByName[variationProperty.name].push(formattedVariant);
2092
+ } else {
2093
+ variantsByName[variationProperty.name] = [formattedVariant];
2094
+ }
2095
+ });
2096
+ });
2097
+ return sortVariants(variantsByName);
2098
+ }
2099
+
2100
+ const SkuVariants = {
2101
+ activeVariations: root => getActiveSkuVariations(root.variations),
2102
+ allVariantsByName: root => getVariantsByName(root.isVariantOf.skuSpecifications),
2103
+ slugsMap: (root, args) => createSlugsMap(root.isVariantOf.items, // Since `dominantVariantProperty` is a required argument, we can safely
2104
+ // access it.
2105
+ args.dominantVariantName, root.isVariantOf.linkText),
2106
+ availableVariations: (root, args) => {
2107
+ // Since `dominantVariantProperty` is a required argument, we can safely
2108
+ // access it.
2109
+ const dominantVariantName = args.dominantVariantName;
2110
+ const activeVariations = getActiveSkuVariations(root.variations);
2111
+ const activeDominantVariationValue = activeVariations[dominantVariantName];
2112
+ const filteredFormattedVariations = getFormattedVariations(root.isVariantOf.items, dominantVariantName, activeDominantVariationValue);
2113
+ return filteredFormattedVariations;
2114
+ }
2115
+ };
2116
+
1897
2117
  const Resolvers = {
1898
2118
  StoreCollection,
1899
2119
  StoreAggregateOffer,
@@ -1909,6 +2129,7 @@ const Resolvers = {
1909
2129
  StoreProductGroup,
1910
2130
  StoreSearchResult,
1911
2131
  StorePropertyValue,
2132
+ SkuVariants,
1912
2133
  ObjectOrString,
1913
2134
  Query,
1914
2135
  Mutation
@@ -1969,8 +2190,8 @@ var doc$c = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","de
1969
2190
  var doc$d = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.","block":true},"name":{"kind":"Name","value":"StoreProduct"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Meta tag data.","block":true},"name":{"kind":"Name","value":"seo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSeo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of items consisting of chain linked web pages, ending with the current page.","block":true},"name":{"kind":"Name","value":"breadcrumbList"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBreadcrumbList"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Corresponding collection URL slug, with which to retrieve this entity.","block":true},"name":{"kind":"Name","value":"slug"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.","block":true},"name":{"kind":"Name","value":"productID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product brand.","block":true},"name":{"kind":"Name","value":"brand"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBrand"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product description.","block":true},"name":{"kind":"Name","value":"description"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of images.","block":true},"name":{"kind":"Name","value":"image"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreImage"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Aggregate offer information.","block":true},"name":{"kind":"Name","value":"offers"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateOffer"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Stock Keeping Unit. Merchant-specific ID for the product.","block":true},"name":{"kind":"Name","value":"sku"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Global Trade Item Number.","block":true},"name":{"kind":"Name","value":"gtin"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with review information.","block":true},"name":{"kind":"Name","value":"review"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreReview"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Aggregate ratings data.","block":true},"name":{"kind":"Name","value":"aggregateRating"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateRating"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Indicates product group related to this product.","block":true},"name":{"kind":"Name","value":"isVariantOf"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductGroup"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of additional properties.","block":true},"name":{"kind":"Name","value":"additionalProperty"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePropertyValue"}}}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Product input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.","block":true},"name":{"kind":"Name","value":"IStoreProduct"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Stock Keeping Unit. Merchant-specific ID for the product.","block":true},"name":{"kind":"Name","value":"sku"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Product name.","block":true},"name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Array of product images.","block":true},"name":{"kind":"Name","value":"image"},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreImage"}}}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Custom Product Additional Properties.","block":true},"name":{"kind":"Name","value":"additionalProperty"},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStorePropertyValue"}}}},"directives":[]}]}],"loc":{"start":0,"end":2154}};
1970
2191
  doc$d.loc.source = {"body":"\"\"\"\nProduct information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n\"\"\"\ntype StoreProduct {\n \"\"\"\n Meta tag data.\n \"\"\"\n seo: StoreSeo!\n \"\"\"\n List of items consisting of chain linked web pages, ending with the current page.\n \"\"\"\n breadcrumbList: StoreBreadcrumbList!\n \"\"\"\n Corresponding collection URL slug, with which to retrieve this entity.\n \"\"\"\n slug: String!\n \"\"\"\n Product name.\n \"\"\"\n name: String!\n \"\"\"\n Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.\n \"\"\"\n productID: String!\n \"\"\"\n Product brand.\n \"\"\"\n brand: StoreBrand!\n \"\"\"\n Product description.\n \"\"\"\n description: String!\n \"\"\"\n Array of images.\n \"\"\"\n image: [StoreImage!]!\n \"\"\"\n Aggregate offer information.\n \"\"\"\n offers: StoreAggregateOffer!\n \"\"\"\n Stock Keeping Unit. Merchant-specific ID for the product.\n \"\"\"\n sku: String!\n \"\"\"\n Global Trade Item Number.\n \"\"\"\n gtin: String!\n \"\"\"\n Array with review information.\n \"\"\"\n review: [StoreReview!]!\n \"\"\"\n Aggregate ratings data.\n \"\"\"\n aggregateRating: StoreAggregateRating!\n \"\"\"\n Indicates product group related to this product.\n \"\"\"\n isVariantOf: StoreProductGroup!\n \"\"\"\n Array of additional properties.\n \"\"\"\n additionalProperty: [StorePropertyValue!]!\n}\n\n\"\"\"\nProduct input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n\"\"\"\ninput IStoreProduct {\n \"\"\"\n Stock Keeping Unit. Merchant-specific ID for the product.\n \"\"\"\n sku: String!\n \"\"\"\n Product name.\n \"\"\"\n name: String!\n \"\"\"\n Array of product images.\n \"\"\"\n image: [IStoreImage!]!\n \"\"\"\n Custom Product Additional Properties.\n \"\"\"\n additionalProperty: [IStorePropertyValue!]\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1971
2192
 
1972
- var doc$e = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.","block":true},"name":{"kind":"Name","value":"StoreProductGroup"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).","block":true},"name":{"kind":"Name","value":"hasVariant"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product group ID.","block":true},"name":{"kind":"Name","value":"productGroupID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product group name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of additional properties.","block":true},"name":{"kind":"Name","value":"additionalProperty"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePropertyValue"}}}}},"directives":[]}]}],"loc":{"start":0,"end":916}};
1973
- doc$e.loc.source = {"body":"\"\"\"\nProduct group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n\"\"\"\ntype StoreProductGroup {\n \"\"\"\n Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).\n \"\"\"\n hasVariant: [StoreProduct!]!\n \"\"\"\n Product group ID.\n \"\"\"\n productGroupID: String!\n \"\"\"\n Product group name.\n \"\"\"\n name: String!\n \"\"\"\n Array of additional properties.\n \"\"\"\n additionalProperty: [StorePropertyValue!]!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2193
+ var doc$e = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.","block":true},"name":{"kind":"Name","value":"StoreProductGroup"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).","block":true},"name":{"kind":"Name","value":"hasVariant"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product group ID.","block":true},"name":{"kind":"Name","value":"productGroupID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product group name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of additional properties.","block":true},"name":{"kind":"Name","value":"additionalProperty"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePropertyValue"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Object containing data structures to facilitate handling different SKU\nvariant properties. Specially useful for implementing SKU selection \ncomponents.","block":true},"name":{"kind":"Name","value":"skuVariants"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"SkuVariants"}},"directives":[]}]}],"loc":{"start":0,"end":1113}};
2194
+ doc$e.loc.source = {"body":"\"\"\"\nProduct group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n\"\"\"\ntype StoreProductGroup {\n \"\"\"\n Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).\n \"\"\"\n hasVariant: [StoreProduct!]!\n \"\"\"\n Product group ID.\n \"\"\"\n productGroupID: String!\n \"\"\"\n Product group name.\n \"\"\"\n name: String!\n \"\"\"\n Array of additional properties.\n \"\"\"\n additionalProperty: [StorePropertyValue!]!\n \"\"\"\n Object containing data structures to facilitate handling different SKU\n variant properties. Specially useful for implementing SKU selection \n components.\n \"\"\"\n skuVariants: SkuVariants\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1974
2195
 
1975
2196
  var doc$f = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Each product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.","block":true},"name":{"kind":"Name","value":"StoreProductEdge"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Each product node contains the information of a product returned by the query.","block":true},"name":{"kind":"Name","value":"node"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product cursor. Used as pagination reference.","block":true},"name":{"kind":"Name","value":"cursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product connections, including pagination information and products returned by the query.","block":true},"name":{"kind":"Name","value":"StoreProductConnection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product pagination information.","block":true},"name":{"kind":"Name","value":"pageInfo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePageInfo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with product connection edges, each containing a product and a corresponding cursor.","block":true},"name":{"kind":"Name","value":"edges"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductEdge"}}}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Each collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.","block":true},"name":{"kind":"Name","value":"StoreCollectionEdge"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Each collection node contains the information of a product collection returned by the query.","block":true},"name":{"kind":"Name","value":"node"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollection"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Collection cursor. Used as pagination reference.","block":true},"name":{"kind":"Name","value":"cursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Collection connections, including pagination information and collections returned by the query.","block":true},"name":{"kind":"Name","value":"StoreCollectionConnection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Collection pagination information.","block":true},"name":{"kind":"Name","value":"pageInfo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePageInfo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with collection connection page edges, each containing a collection and a corresponding cursor..","block":true},"name":{"kind":"Name","value":"edges"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollectionEdge"}}}}},"directives":[]}]},{"kind":"EnumTypeDefinition","description":{"kind":"StringValue","value":"Product search results sorting options.","block":true},"name":{"kind":"Name","value":"StoreSort"},"directives":[],"values":[{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by price, from highest to lowest.","block":true},"name":{"kind":"Name","value":"price_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by price, from lowest to highest.","block":true},"name":{"kind":"Name","value":"price_asc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by orders, from highest to lowest.","block":true},"name":{"kind":"Name","value":"orders_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by name, in reverse alphabetical order.","block":true},"name":{"kind":"Name","value":"name_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by name, in alphabetical order.","block":true},"name":{"kind":"Name","value":"name_asc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by release date, from highest to lowest.","block":true},"name":{"kind":"Name","value":"release_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by discount value, from highest to lowest.","block":true},"name":{"kind":"Name","value":"discount_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by product score, from highest to lowest.","block":true},"name":{"kind":"Name","value":"score_desc"},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Selected search facet input.","block":true},"name":{"kind":"Name","value":"IStoreSelectedFacet"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Selected search facet key.","block":true},"name":{"kind":"Name","value":"key"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Selected search facet value.","block":true},"name":{"kind":"Name","value":"value"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"EnumTypeDefinition","description":{"kind":"StringValue","value":"Search facet type.","block":true},"name":{"kind":"Name","value":"StoreFacetType"},"directives":[],"values":[{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Indicates boolean search facet.","block":true},"name":{"kind":"Name","value":"BOOLEAN"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Indicates range type search facet.","block":true},"name":{"kind":"Name","value":"RANGE"},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Suggestion term.","block":true},"name":{"kind":"Name","value":"StoreSuggestionTerm"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The term.","block":true},"name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Its occurrences count.","block":true},"name":{"kind":"Name","value":"count"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Suggestions information.","block":true},"name":{"kind":"Name","value":"StoreSuggestions"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with suggestion terms.","block":true},"name":{"kind":"Name","value":"terms"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSuggestionTerm"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with suggestion products' information.","block":true},"name":{"kind":"Name","value":"products"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Search result.","block":true},"name":{"kind":"Name","value":"StoreSearchResult"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Search result products.","block":true},"name":{"kind":"Name","value":"products"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductConnection"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of search result facets.","block":true},"name":{"kind":"Name","value":"facets"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreFacet"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Search result suggestions.","block":true},"name":{"kind":"Name","value":"suggestions"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSuggestions"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"Query"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns the details of a product based on the specified locator.","block":true},"name":{"kind":"Name","value":"product"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"An array of selected search facets.","block":true},"name":{"kind":"Name","value":"locator"},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreSelectedFacet"}}}}},"directives":[]}],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns the details of a collection based on the collection slug.","block":true},"name":{"kind":"Name","value":"collection"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Collection slug.","block":true},"name":{"kind":"Name","value":"slug"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollection"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns the result of a product, facet, or suggestion search.","block":true},"name":{"kind":"Name","value":"search"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search pagination argument, indicating how many results should be returned from the complete result list.","block":true},"name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.","block":true},"name":{"kind":"Name","value":"after"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search results sorting mode.","block":true},"name":{"kind":"Name","value":"sort"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSort"}},"defaultValue":{"kind":"EnumValue","value":"score_desc"},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search term.","block":true},"name":{"kind":"Name","value":"term"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"","block":false},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Array of selected search facets.","block":true},"name":{"kind":"Name","value":"selectedFacets"},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreSelectedFacet"}}}},"directives":[]}],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSearchResult"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns information about all products.","block":true},"name":{"kind":"Name","value":"allProducts"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Product pagination argument, indicating how many items should be returned from the complete result list.","block":true},"name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.","block":true},"name":{"kind":"Name","value":"after"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductConnection"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns information about all collections.","block":true},"name":{"kind":"Name","value":"allCollections"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Collection pagination argument, indicating how many items should be returned from the complete result list.","block":true},"name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.","block":true},"name":{"kind":"Name","value":"after"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollectionConnection"}}},"directives":[]}]}],"loc":{"start":0,"end":4916}};
1976
2197
  doc$f.loc.source = {"body":"\"\"\"\nEach product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.\n\"\"\"\ntype StoreProductEdge {\n \"\"\"\n Each product node contains the information of a product returned by the query.\n \"\"\"\n node: StoreProduct!\n \"\"\"\n Product cursor. Used as pagination reference.\n \"\"\"\n cursor: String!\n}\n\n\"\"\"\nProduct connections, including pagination information and products returned by the query.\n\"\"\"\ntype StoreProductConnection {\n \"\"\"\n Product pagination information.\n \"\"\"\n pageInfo: StorePageInfo!\n \"\"\"\n Array with product connection edges, each containing a product and a corresponding cursor.\n \"\"\"\n edges: [StoreProductEdge!]!\n}\n\n\"\"\"\nEach collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.\n\"\"\"\ntype StoreCollectionEdge {\n \"\"\"\n Each collection node contains the information of a product collection returned by the query.\n \"\"\"\n node: StoreCollection!\n \"\"\"\n Collection cursor. Used as pagination reference.\n \"\"\"\n cursor: String!\n}\n\n\"\"\"\nCollection connections, including pagination information and collections returned by the query.\n\"\"\"\ntype StoreCollectionConnection {\n \"\"\"\n Collection pagination information.\n \"\"\"\n pageInfo: StorePageInfo!\n \"\"\"\n Array with collection connection page edges, each containing a collection and a corresponding cursor..\n \"\"\"\n edges: [StoreCollectionEdge!]!\n}\n\n\"\"\"\nProduct search results sorting options.\n\"\"\"\nenum StoreSort {\n \"\"\"\n Sort by price, from highest to lowest.\n \"\"\"\n price_desc\n \"\"\"\n Sort by price, from lowest to highest.\n \"\"\"\n price_asc\n \"\"\"\n Sort by orders, from highest to lowest.\n \"\"\"\n orders_desc\n \"\"\"\n Sort by name, in reverse alphabetical order.\n \"\"\"\n name_desc\n \"\"\"\n Sort by name, in alphabetical order.\n \"\"\"\n name_asc\n \"\"\"\n Sort by release date, from highest to lowest.\n \"\"\"\n release_desc\n \"\"\"\n Sort by discount value, from highest to lowest.\n \"\"\"\n discount_desc\n \"\"\"\n Sort by product score, from highest to lowest.\n \"\"\"\n score_desc\n}\n\n\"\"\"\nSelected search facet input.\n\"\"\"\ninput IStoreSelectedFacet {\n \"\"\"\n Selected search facet key.\n \"\"\"\n key: String!\n \"\"\"\n Selected search facet value.\n \"\"\"\n value: String!\n}\n\n\"\"\"\nSearch facet type.\n\"\"\"\nenum StoreFacetType {\n \"\"\"\n Indicates boolean search facet.\n \"\"\"\n BOOLEAN\n \"\"\"\n Indicates range type search facet.\n \"\"\"\n RANGE\n}\n\n\"\"\"\nSuggestion term.\n\"\"\"\ntype StoreSuggestionTerm {\n \"\"\"\n The term.\n \"\"\"\n value: String!\n \"\"\"\n Its occurrences count.\n \"\"\"\n count: Int!\n}\n\n\"\"\"\nSuggestions information.\n\"\"\"\ntype StoreSuggestions {\n \"\"\"\n Array with suggestion terms.\n \"\"\"\n terms: [StoreSuggestionTerm!]!\n \"\"\"\n Array with suggestion products' information.\n \"\"\"\n products: [StoreProduct!]!\n}\n\n\"\"\"\nSearch result.\n\"\"\"\ntype StoreSearchResult {\n \"\"\"\n Search result products.\n \"\"\"\n products: StoreProductConnection!\n \"\"\"\n Array of search result facets.\n \"\"\"\n facets: [StoreFacet!]!\n \"\"\"\n Search result suggestions.\n \"\"\"\n suggestions: StoreSuggestions!\n}\n\ntype Query {\n \"\"\"\n Returns the details of a product based on the specified locator.\n \"\"\"\n product(\n \"\"\"\n An array of selected search facets.\n \"\"\"\n locator: [IStoreSelectedFacet!]!\n ): StoreProduct!\n\n \"\"\"\n Returns the details of a collection based on the collection slug.\n \"\"\"\n collection(\n \"\"\"\n Collection slug.\n \"\"\"\n slug: String!\n ): StoreCollection!\n\n \"\"\"\n Returns the result of a product, facet, or suggestion search.\n \"\"\"\n search(\n \"\"\"\n Search pagination argument, indicating how many results should be returned from the complete result list.\n \"\"\"\n first: Int!\n \"\"\"\n Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.\n \"\"\"\n after: String\n \"\"\"\n Search results sorting mode.\n \"\"\"\n sort: StoreSort = score_desc\n \"\"\"\n Search term.\n \"\"\"\n term: String = \"\"\n \"\"\"\n Array of selected search facets.\n \"\"\"\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreSearchResult!\n\n \"\"\"\n Returns information about all products.\n \"\"\"\n allProducts(\n \"\"\"\n Product pagination argument, indicating how many items should be returned from the complete result list.\n \"\"\"\n first: Int!,\n \"\"\"\n Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n \"\"\"\n after: String\n ): StoreProductConnection!\n\n \"\"\"\n Returns information about all collections.\n \"\"\"\n allCollections(\n \"\"\"\n Collection pagination argument, indicating how many items should be returned from the complete result list.\n \"\"\"\n first: Int!,\n \"\"\"\n Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n \"\"\"\n after: String\n ): StoreCollectionConnection!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
@@ -2002,7 +2223,10 @@ var doc$n = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","de
2002
2223
  var doc$o = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Newsletter information.","block":true},"name":{"kind":"Name","value":"PersonNewsletter"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Person's ID in the newsletter list.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Person data input to the newsletter.","block":true},"name":{"kind":"Name","value":"IPersonNewsletter"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Person's name.","block":true},"name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Person's email.","block":true},"name":{"kind":"Name","value":"email"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":289}};
2003
2224
  doc$o.loc.source = {"body":"\"\"\"\nNewsletter information.\n\"\"\"\n\ntype PersonNewsletter {\n \"\"\"\n Person's ID in the newsletter list.\n \"\"\"\n id: String!\n}\n\n\"\"\"\nPerson data input to the newsletter.\n\"\"\"\ninput IPersonNewsletter {\n \"\"\"\n Person's name.\n \"\"\"\n name: String!\n \"\"\"\n Person's email.\n \"\"\"\n email: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2004
2225
 
2005
- const typeDefs = /*#__PURE__*/[doc$f, doc$8, doc$3, doc$4, doc$5, doc$6, doc$7, doc$c, doc$d, doc$h, doc$9, doc$1, doc$g, doc$2, doc$e, doc$b, doc, doc$a, doc$i, doc$j, doc$k, doc$l, doc$m, doc$n, doc$o].map(print).join('\n');
2226
+ var doc$p = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"SkuVariants"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"SKU property values for the current SKU.","block":true},"name":{"kind":"Name","value":"activeVariations"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"ActiveVariations"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"All available options for each SKU variant property, indexed by their name.","block":true},"name":{"kind":"Name","value":"allVariantsByName"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"VariantsByName"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Maps property value combinations to their respective SKU's slug. Enables\nus to retrieve the slug for the SKU that matches the currently selected\nvariations in O(1) time.","block":true},"name":{"kind":"Name","value":"slugsMap"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"dominantVariantName"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"SlugsMap"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Available options for each varying SKU property, taking into account the\n`dominantVariantName` property. Returns all available options for the \ndominant property, and only options that can be combined with its current\nvalue for other properties.","block":true},"name":{"kind":"Name","value":"availableVariations"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"dominantVariantName"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"FormattedVariants"}},"directives":[]}]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example: \n\n```json\n{ \n 'Color-Red-Size-40': 'classic-shoes-37'\n}\n```","block":true},"name":{"kind":"Name","value":"SlugsMap"},"directives":[]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example:\n\n```json\n{\n Color: 'Red', Size: '42'\n}\n```","block":true},"name":{"kind":"Name","value":"ActiveVariations"},"directives":[]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example:\n\n```json\n{\n Color: [ \"Red\", \"Blue\", \"Green\" ],\n Size: [ \"40\", \"41\" ]\n}\n```","block":true},"name":{"kind":"Name","value":"VariantsByName"},"directives":[]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example: \n\n```json\n{\n Color: [\n { \n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n },\n { \n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ],\n Size: [\n { \n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ]\n}\n```","block":true},"name":{"kind":"Name","value":"FormattedVariants"},"directives":[]}],"loc":{"start":0,"end":1584}};
2227
+ doc$p.loc.source = {"body":"type SkuVariants {\n \"\"\"\n SKU property values for the current SKU.\n \"\"\"\n activeVariations: ActiveVariations\n \"\"\"\n All available options for each SKU variant property, indexed by their name.\n \"\"\"\n allVariantsByName: VariantsByName\n \"\"\"\n Maps property value combinations to their respective SKU's slug. Enables\n us to retrieve the slug for the SKU that matches the currently selected\n variations in O(1) time.\n \"\"\"\n slugsMap(dominantVariantName: String!): SlugsMap\n \"\"\"\n Available options for each varying SKU property, taking into account the\n `dominantVariantName` property. Returns all available options for the \n dominant property, and only options that can be combined with its current\n value for other properties.\n \"\"\"\n availableVariations(dominantVariantName: String!): FormattedVariants\n}\n\n\"\"\"\nExample: \n\n```json\n{ \n 'Color-Red-Size-40': 'classic-shoes-37'\n}\n```\n\"\"\"\nscalar SlugsMap\n\"\"\"\nExample:\n\n```json\n{\n Color: 'Red', Size: '42'\n}\n```\n\"\"\"\nscalar ActiveVariations\n\"\"\"\nExample:\n\n```json\n{\n Color: [ \"Red\", \"Blue\", \"Green\" ],\n Size: [ \"40\", \"41\" ]\n}\n```\n\"\"\"\nscalar VariantsByName\n\"\"\"\nExample: \n\n```json\n{\n Color: [\n { \n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n },\n { \n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ],\n Size: [\n { \n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ]\n}\n```\n\"\"\"\nscalar FormattedVariants\n\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2228
+
2229
+ const typeDefs = /*#__PURE__*/[doc$f, doc$8, doc$3, doc$4, doc$5, doc$6, doc$7, doc$c, doc$d, doc$h, doc$9, doc$1, doc$g, doc$2, doc$e, doc$b, doc, doc$a, doc$i, doc$j, doc$k, doc$l, doc$m, doc$n, doc$o, doc$p].map(print).join('\n');
2006
2230
 
2007
2231
  const platforms = {
2008
2232
  vtex: {