@faststore/api 1.5.8 → 1.5.12

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/__generated__/schema.d.ts +7 -0
  3. package/dist/api.cjs.development.js +78 -39
  4. package/dist/api.cjs.development.js.map +1 -1
  5. package/dist/api.cjs.production.min.js +1 -1
  6. package/dist/api.cjs.production.min.js.map +1 -1
  7. package/dist/api.esm.js +78 -39
  8. package/dist/api.esm.js.map +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/platforms/vtex/clients/commerce/types/Portal.d.ts +11 -2
  11. package/dist/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +1 -1
  12. package/dist/platforms/vtex/index.d.ts +2 -2
  13. package/dist/platforms/vtex/loaders/collection.d.ts +6 -0
  14. package/dist/platforms/vtex/loaders/index.d.ts +1 -0
  15. package/dist/platforms/vtex/resolvers/collection.d.ts +2 -2
  16. package/dist/platforms/vtex/resolvers/query.d.ts +1 -1
  17. package/package.json +4 -3
  18. package/src/__generated__/schema.ts +8 -0
  19. package/src/platforms/vtex/clients/commerce/types/Portal.ts +13 -8
  20. package/src/platforms/vtex/clients/search/types/ProductSearchResult.ts +1 -1
  21. package/src/platforms/vtex/loaders/collection.ts +50 -0
  22. package/src/platforms/vtex/loaders/index.ts +3 -0
  23. package/src/platforms/vtex/resolvers/collection.ts +15 -17
  24. package/src/platforms/vtex/resolvers/product.ts +5 -0
  25. package/src/platforms/vtex/resolvers/productGroup.ts +10 -0
  26. package/src/platforms/vtex/resolvers/query.ts +16 -24
  27. package/src/typeDefs/index.ts +2 -0
  28. package/src/typeDefs/product.graphql +1 -0
  29. package/src/typeDefs/productGroup.graphql +1 -0
  30. package/src/typeDefs/propertyValue.graphql +4 -0
package/dist/api.esm.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { makeExecutableSchema } from '@graphql-tools/schema';
2
2
  import fetch from 'isomorphic-unfetch';
3
3
  import DataLoader from 'dataloader';
4
+ import pLimit from 'p-limit';
4
5
  import rawSlugify from '@sindresorhus/slugify';
5
6
  import deepEquals from 'fast-deep-equal';
6
7
  import { print } from 'graphql';
@@ -241,14 +242,40 @@ const getSkuLoader = (_, clients) => {
241
242
  });
242
243
  };
243
244
 
245
+ const CONCURRENT_REQUESTS_MAX = 20;
246
+ const collectionPageTypes = /*#__PURE__*/new Set(['brand', 'category', 'department', 'subcategory']);
247
+ const isCollectionPageType = x => typeof x.pageType === 'string' && collectionPageTypes.has(x.pageType.toLowerCase());
248
+ const getCollectionLoader = (_, clients) => {
249
+ const limit = pLimit(CONCURRENT_REQUESTS_MAX);
250
+
251
+ const loader = async slugs => {
252
+ return Promise.all(slugs.map(slug => limit(async () => {
253
+ const page = await clients.commerce.catalog.portal.pagetype(slug);
254
+
255
+ if (isCollectionPageType(page)) {
256
+ return page;
257
+ }
258
+
259
+ throw new NotFoundError(`Catalog returned ${page.pageType} for slug: ${slug}. This usually happens when there is more than one category with the same name in the same category tree level.`);
260
+ })));
261
+ };
262
+
263
+ return new DataLoader(loader, {
264
+ // DataLoader is being used to cache requests, not to batch them
265
+ batch: false
266
+ });
267
+ };
268
+
244
269
  const getLoaders = (options, {
245
270
  clients
246
271
  }) => {
247
272
  const skuLoader = getSkuLoader(options, clients);
248
273
  const simulationLoader = getSimulationLoader(options, clients);
274
+ const collectionLoader = getCollectionLoader(options, clients);
249
275
  return {
250
276
  skuLoader,
251
- simulationLoader
277
+ simulationLoader,
278
+ collectionLoader
252
279
  };
253
280
  };
254
281
 
@@ -292,14 +319,12 @@ const slugify = path => rawSlugify(path, {
292
319
 
293
320
  const isBrand = x => x.type === 'brand';
294
321
 
295
- const isPortalPageType = x => typeof x.pageType === 'string';
296
-
297
322
  const slugify$1 = root => {
298
323
  if (isBrand(root)) {
299
- return slugify(root.name);
324
+ return slugify(root.name.toLowerCase());
300
325
  }
301
326
 
302
- if (isPortalPageType(root)) {
327
+ if (isCollectionPageType(root)) {
303
328
  return new URL(`https://${root.url}`).pathname.slice(1);
304
329
  }
305
330
 
@@ -311,29 +336,29 @@ const StoreCollection = {
311
336
  id
312
337
  }) => id.toString(),
313
338
  slug: root => slugify$1(root),
314
- seo: root => isBrand(root) || isPortalPageType(root) ? {
339
+ seo: root => isBrand(root) || isCollectionPageType(root) ? {
315
340
  title: root.title,
316
341
  description: root.metaTagDescription
317
342
  } : {
318
343
  title: root.Title,
319
344
  description: root.MetaTagDescription
320
345
  },
321
- type: root => isBrand(root) ? 'Brand' : isPortalPageType(root) ? root.pageType : root.level === 0 ? 'Department' : 'Category',
346
+ type: root => isBrand(root) ? 'Brand' : isCollectionPageType(root) ? root.pageType : root.level === 0 ? 'Department' : 'Category',
322
347
  meta: root => isBrand(root) ? {
323
348
  selectedFacets: [{
324
349
  key: 'brand',
325
350
  value: slugify(root.name)
326
351
  }]
327
352
  } : {
328
- selectedFacets: new URL(isPortalPageType(root) ? `https://${root.url}` : root.url).pathname.slice(1).split('/').map((segment, index) => ({
353
+ selectedFacets: new URL(isCollectionPageType(root) ? `https://${root.url}` : root.url).pathname.slice(1).split('/').map((segment, index) => ({
329
354
  key: `category-${index + 1}`,
330
355
  value: slugify(segment)
331
356
  }))
332
357
  },
333
358
  breadcrumbList: async (root, _, ctx) => {
334
359
  const {
335
- clients: {
336
- commerce
360
+ loaders: {
361
+ collectionLoader
337
362
  }
338
363
  } = ctx;
339
364
  const slug = slugify$1(root);
@@ -346,14 +371,14 @@ const StoreCollection = {
346
371
 
347
372
  const segments = slug.split('/').filter(segment => Boolean(segment));
348
373
  const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
349
- const pageTypes = await Promise.all(slugs.map(s => commerce.catalog.portal.pagetype(s)));
374
+ const collections = await Promise.all(slugs.map(s => collectionLoader.load(s)));
350
375
  return {
351
- itemListElement: pageTypes.map((pageType, index) => ({
352
- item: new URL(`https://${pageType.url}`).pathname.toLowerCase(),
353
- name: pageType.name,
376
+ itemListElement: collections.map((collection, index) => ({
377
+ item: new URL(`https://${collection.url}`).pathname.toLowerCase(),
378
+ name: collection.name,
354
379
  position: index + 1
355
380
  })),
356
- numberOfItems: pageTypes.length
381
+ numberOfItems: collections.length
357
382
  };
358
383
  }
359
384
  };
@@ -714,7 +739,13 @@ const StoreProduct = {
714
739
  },
715
740
  isVariantOf: ({
716
741
  isVariantOf
717
- }) => isVariantOf
742
+ }) => isVariantOf,
743
+ additionalProperty: ({
744
+ attributes = []
745
+ }) => attributes.map(attribute => ({
746
+ name: attribute.key,
747
+ value: attribute.value
748
+ }))
718
749
  };
719
750
 
720
751
  const StoreProductGroup = {
@@ -724,7 +755,17 @@ const StoreProductGroup = {
724
755
  }) => product,
725
756
  name: ({
726
757
  name
727
- }) => name
758
+ }) => name,
759
+ additionalProperty: ({
760
+ textAttributes = [],
761
+ productSpecifications = []
762
+ }) => {
763
+ const specs = new Set(productSpecifications);
764
+ return textAttributes.filter(attribute => specs.has(attribute.labelKey)).map(attribute => ({
765
+ name: attribute.labelKey,
766
+ value: attribute.labelValue
767
+ }));
768
+ }
728
769
  };
729
770
 
730
771
  const getIdFromSlug = slug => {
@@ -795,22 +836,15 @@ const Query = {
795
836
  } = ctx;
796
837
  return skuLoader.load(locator.map(transformSelectedFacet));
797
838
  },
798
- collection: async (_, {
839
+ collection: (_, {
799
840
  slug
800
841
  }, ctx) => {
801
842
  const {
802
- clients: {
803
- commerce
843
+ loaders: {
844
+ collectionLoader
804
845
  }
805
846
  } = ctx;
806
- const result = await commerce.catalog.portal.pagetype(slug);
807
- const whitelist = ['Brand', 'Category', 'Department', 'Subcategory'];
808
-
809
- if (whitelist.includes(result.pageType)) {
810
- return result;
811
- }
812
-
813
- throw new NotFoundError(`Not Found: ${slug}`);
847
+ return collectionLoader.load(slug);
814
848
  },
815
849
  search: async (_, {
816
850
  first,
@@ -858,6 +892,7 @@ const Query = {
858
892
  endCursor: products.total.toString(),
859
893
  totalCount: products.total
860
894
  },
895
+ // after + index is bigger than after+first itself because of the array flat() above
861
896
  edges: skus.map((sku, index) => ({
862
897
  node: sku,
863
898
  cursor: (after + index).toString()
@@ -894,17 +929,18 @@ const Query = {
894
929
  const collections = [...brands.map(x => ({ ...x,
895
930
  type: 'brand'
896
931
  })), ...categories];
932
+ const validCollections = collections // Nullable slugs may cause one route to override the other
933
+ .filter(node => Boolean(StoreCollection.slug(node, null, ctx, null)));
897
934
  return {
898
935
  pageInfo: {
899
- hasNextPage: false,
900
- hasPreviousPage: false,
936
+ hasNextPage: validCollections.length - after > first,
937
+ hasPreviousPage: after > 0,
901
938
  startCursor: '0',
902
- endCursor: '0'
939
+ endCursor: (Math.min(first, validCollections.length - after) - 1).toString()
903
940
  },
904
- edges: collections // Nullable slugs may cause one route to override the other
905
- .filter(node => Boolean(StoreCollection.slug(node, null, ctx, null))).slice(after, first).map((node, index) => ({
941
+ edges: validCollections.slice(after, after + first).map((node, index) => ({
906
942
  node,
907
- cursor: index.toString()
943
+ cursor: (after + index).toString()
908
944
  }))
909
945
  };
910
946
  }
@@ -1034,11 +1070,11 @@ var doc$b = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","na
1034
1070
  var doc$c = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StorePageInfo"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"hasNextPage"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"hasPreviousPage"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"startCursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"endCursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"totalCount"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]}],"loc":{"start":0,"end":197}};
1035
1071
  doc$c.loc.source = {"body":"type StorePageInfo {\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n startCursor: String!\n endCursor: String!\n # Total number of items(products/collections), not pages\n totalCount: Int!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1036
1072
 
1037
- var doc$d = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreProduct"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"seo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSeo"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"breadcrumbList"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBreadcrumbList"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"slug"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"productID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"brand"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBrand"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"description"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"offers"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateOffer"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"sku"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"gtin"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"aggregateRating"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateRating"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"isVariantOf"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductGroup"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStoreProduct"},"directives":[],"fields":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"sku"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"image"},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreImage"}}}}},"directives":[]}]}],"loc":{"start":0,"end":528}};
1038
- doc$d.loc.source = {"body":"type StoreProduct {\n # Meta tag data\n seo: StoreSeo!\n # Location for structured data\n breadcrumbList: StoreBreadcrumbList!\n # Where to retrieve this entity\n slug: String!\n name: String!\n productID: String!\n brand: StoreBrand!\n description: String!\n image: [StoreImage!]!\n offers: StoreAggregateOffer!\n sku: String!\n gtin: String!\n review: [StoreReview!]!\n aggregateRating: StoreAggregateRating!\n isVariantOf: StoreProductGroup!\n}\n\ninput IStoreProduct {\n sku: String!\n name: String!\n image: [IStoreImage!]!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1073
+ var doc$d = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreProduct"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"seo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSeo"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"breadcrumbList"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBreadcrumbList"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"slug"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"productID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"brand"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBrand"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"description"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"offers"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateOffer"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"sku"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"gtin"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"aggregateRating"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateRating"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"isVariantOf"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductGroup"}}},"directives":[]},{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"IStoreProduct"},"directives":[],"fields":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"sku"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"image"},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreImage"}}}}},"directives":[]}]}],"loc":{"start":0,"end":573}};
1074
+ doc$d.loc.source = {"body":"type StoreProduct {\n # Meta tag data\n seo: StoreSeo!\n # Location for structured data\n breadcrumbList: StoreBreadcrumbList!\n # Where to retrieve this entity\n slug: String!\n name: String!\n productID: String!\n brand: StoreBrand!\n description: String!\n image: [StoreImage!]!\n offers: StoreAggregateOffer!\n sku: String!\n gtin: String!\n review: [StoreReview!]!\n aggregateRating: StoreAggregateRating!\n isVariantOf: StoreProductGroup!\n additionalProperty: [StorePropertyValue!]!\n}\n\ninput IStoreProduct {\n sku: String!\n name: String!\n image: [IStoreImage!]!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1039
1075
 
1040
- var doc$e = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreProductGroup"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"productGroupID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":100}};
1041
- doc$e.loc.source = {"body":"type StoreProductGroup {\n hasVariant: [StoreProduct!]!\n productGroupID: String!\n name: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1076
+ var doc$e = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreProductGroup"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"productGroupID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","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":145}};
1077
+ doc$e.loc.source = {"body":"type StoreProductGroup {\n hasVariant: [StoreProduct!]!\n productGroupID: String!\n name: String!\n additionalProperty: [StorePropertyValue!]!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1042
1078
 
1043
1079
  var doc$f = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreProductEdge"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"node"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"cursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreProductConnection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"pageInfo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePageInfo"}}},"directives":[]},{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"StoreCollectionEdge"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"node"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollection"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"cursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreCollectionConnection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"pageInfo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePageInfo"}}},"directives":[]},{"kind":"FieldDefinition","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","name":{"kind":"Name","value":"StoreSort"},"directives":[],"values":[{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"price_desc"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"price_asc"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"orders_desc"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"name_desc"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"name_asc"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"release_desc"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"discount_desc"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"score_desc"},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStoreSelectedFacet"},"directives":[],"fields":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"key"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"value"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"EnumTypeDefinition","name":{"kind":"Name","value":"StoreFacetType"},"directives":[],"values":[{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"BOOLEAN"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"RANGE"},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StoreSearchResult"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"products"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductConnection"}}},"directives":[]},{"kind":"FieldDefinition","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":"ObjectTypeDefinition","name":{"kind":"Name","value":"Query"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"product"},"arguments":[{"kind":"InputValueDefinition","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","name":{"kind":"Name","value":"collection"},"arguments":[{"kind":"InputValueDefinition","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","name":{"kind":"Name","value":"search"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"after"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"sort"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSort"}},"defaultValue":{"kind":"EnumValue","value":"score_desc"},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"term"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"","block":false},"directives":[]},{"kind":"InputValueDefinition","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","name":{"kind":"Name","value":"allProducts"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","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","name":{"kind":"Name","value":"allCollections"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","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":1077}};
1044
1080
  doc$f.loc.source = {"body":"type StoreProductEdge {\n node: StoreProduct!\n cursor: String!\n}\n\ntype StoreProductConnection {\n pageInfo: StorePageInfo!\n edges: [StoreProductEdge!]!\n}\n\ntype StoreCollectionEdge {\n node: StoreCollection!\n cursor: String!\n}\n\ntype StoreCollectionConnection {\n pageInfo: StorePageInfo!\n edges: [StoreCollectionEdge!]!\n}\n\nenum StoreSort {\n price_desc\n price_asc\n orders_desc\n name_desc\n name_asc\n release_desc\n discount_desc\n score_desc\n}\n\ninput IStoreSelectedFacet {\n key: String!\n value: String!\n}\n\nenum StoreFacetType {\n BOOLEAN\n RANGE\n}\n\ntype StoreSearchResult {\n products: StoreProductConnection!\n facets: [StoreFacet!]!\n}\n\ntype Query {\n product(locator: [IStoreSelectedFacet!]!): StoreProduct!\n\n collection(slug: String!): StoreCollection!\n\n search(\n first: Int!\n after: String\n sort: StoreSort = score_desc\n term: String = \"\"\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreSearchResult!\n\n allProducts(first: Int!, after: String): StoreProductConnection!\n\n allCollections(first: Int!, after: String): StoreCollectionConnection!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
@@ -1055,7 +1091,10 @@ var doc$i = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","na
1055
1091
  var doc$j = {"kind":"Document","definitions":[{"kind":"EnumTypeDefinition","name":{"kind":"Name","value":"StoreStatus"},"directives":[],"values":[{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"INFO"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"WARNING"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"ERROR"},"directives":[]}]}],"loc":{"start":0,"end":46}};
1056
1092
  doc$j.loc.source = {"body":"enum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1057
1093
 
1058
- 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].map(print).join('\n');
1094
+ var doc$k = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"StorePropertyValue"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":61}};
1095
+ doc$k.loc.source = {"body":"type StorePropertyValue {\n value: String!\n name: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1096
+
1097
+ 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].map(print).join('\n');
1059
1098
 
1060
1099
  const platforms = {
1061
1100
  vtex: {