@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/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.5.12 (2022-02-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * allCollections query pagination and pagetype timeout errors ([#1140](https://github.com/vtex/faststore/issues/1140)) ([0150222](https://github.com/vtex/faststore/commit/01502220fb903c62f0b33b9a703fb45daafae141))
12
+
13
+
14
+
15
+
16
+
17
+ ## 1.5.11 (2022-02-18)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **gatsby-plugin-nginx:** remove trailing slash from incoming requests ([#1145](https://github.com/vtex/faststore/issues/1145)) ([db6f1e1](https://github.com/vtex/faststore/commit/db6f1e173ec43747bf9cfa244b81d86db8a25ce3))
23
+
24
+
25
+
26
+
27
+
28
+ ## 1.5.10 (2022-02-17)
29
+
30
+
31
+ ### Features
32
+
33
+ * **api:** Add additional property ([#1107](https://github.com/vtex/faststore/issues/1107)) ([bbcfc4a](https://github.com/vtex/faststore/commit/bbcfc4af68148adb54d66a3f1d28a9817ad2956c))
34
+
35
+
36
+
37
+
38
+
39
+ ## 1.5.9 (2022-02-16)
40
+
41
+ **Note:** Version bump only for package @faststore/api
42
+
43
+
44
+
45
+
46
+
6
47
  ## 1.5.8 (2022-02-15)
7
48
 
8
49
 
@@ -215,6 +215,7 @@ export declare type StorePageInfo = {
215
215
  };
216
216
  export declare type StoreProduct = {
217
217
  __typename?: 'StoreProduct';
218
+ additionalProperty: Array<StorePropertyValue>;
218
219
  aggregateRating: StoreAggregateRating;
219
220
  brand: StoreBrand;
220
221
  breadcrumbList: StoreBreadcrumbList;
@@ -242,10 +243,16 @@ export declare type StoreProductEdge = {
242
243
  };
243
244
  export declare type StoreProductGroup = {
244
245
  __typename?: 'StoreProductGroup';
246
+ additionalProperty: Array<StorePropertyValue>;
245
247
  hasVariant: Array<StoreProduct>;
246
248
  name: Scalars['String'];
247
249
  productGroupID: Scalars['String'];
248
250
  };
251
+ export declare type StorePropertyValue = {
252
+ __typename?: 'StorePropertyValue';
253
+ name: Scalars['String'];
254
+ value: Scalars['String'];
255
+ };
249
256
  export declare type StoreReview = {
250
257
  __typename?: 'StoreReview';
251
258
  author: StoreAuthor;
@@ -7,6 +7,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
7
7
  var schema = require('@graphql-tools/schema');
8
8
  var fetch = _interopDefault(require('isomorphic-unfetch'));
9
9
  var DataLoader = _interopDefault(require('dataloader'));
10
+ var pLimit = _interopDefault(require('p-limit'));
10
11
  var rawSlugify = _interopDefault(require('@sindresorhus/slugify'));
11
12
  var deepEquals = _interopDefault(require('fast-deep-equal'));
12
13
  var graphql = require('graphql');
@@ -247,14 +248,40 @@ const getSkuLoader = (_, clients) => {
247
248
  });
248
249
  };
249
250
 
251
+ const CONCURRENT_REQUESTS_MAX = 20;
252
+ const collectionPageTypes = /*#__PURE__*/new Set(['brand', 'category', 'department', 'subcategory']);
253
+ const isCollectionPageType = x => typeof x.pageType === 'string' && collectionPageTypes.has(x.pageType.toLowerCase());
254
+ const getCollectionLoader = (_, clients) => {
255
+ const limit = pLimit(CONCURRENT_REQUESTS_MAX);
256
+
257
+ const loader = async slugs => {
258
+ return Promise.all(slugs.map(slug => limit(async () => {
259
+ const page = await clients.commerce.catalog.portal.pagetype(slug);
260
+
261
+ if (isCollectionPageType(page)) {
262
+ return page;
263
+ }
264
+
265
+ 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.`);
266
+ })));
267
+ };
268
+
269
+ return new DataLoader(loader, {
270
+ // DataLoader is being used to cache requests, not to batch them
271
+ batch: false
272
+ });
273
+ };
274
+
250
275
  const getLoaders = (options, {
251
276
  clients
252
277
  }) => {
253
278
  const skuLoader = getSkuLoader(options, clients);
254
279
  const simulationLoader = getSimulationLoader(options, clients);
280
+ const collectionLoader = getCollectionLoader(options, clients);
255
281
  return {
256
282
  skuLoader,
257
- simulationLoader
283
+ simulationLoader,
284
+ collectionLoader
258
285
  };
259
286
  };
260
287
 
@@ -298,14 +325,12 @@ const slugify = path => rawSlugify(path, {
298
325
 
299
326
  const isBrand = x => x.type === 'brand';
300
327
 
301
- const isPortalPageType = x => typeof x.pageType === 'string';
302
-
303
328
  const slugify$1 = root => {
304
329
  if (isBrand(root)) {
305
- return slugify(root.name);
330
+ return slugify(root.name.toLowerCase());
306
331
  }
307
332
 
308
- if (isPortalPageType(root)) {
333
+ if (isCollectionPageType(root)) {
309
334
  return new URL(`https://${root.url}`).pathname.slice(1);
310
335
  }
311
336
 
@@ -317,29 +342,29 @@ const StoreCollection = {
317
342
  id
318
343
  }) => id.toString(),
319
344
  slug: root => slugify$1(root),
320
- seo: root => isBrand(root) || isPortalPageType(root) ? {
345
+ seo: root => isBrand(root) || isCollectionPageType(root) ? {
321
346
  title: root.title,
322
347
  description: root.metaTagDescription
323
348
  } : {
324
349
  title: root.Title,
325
350
  description: root.MetaTagDescription
326
351
  },
327
- type: root => isBrand(root) ? 'Brand' : isPortalPageType(root) ? root.pageType : root.level === 0 ? 'Department' : 'Category',
352
+ type: root => isBrand(root) ? 'Brand' : isCollectionPageType(root) ? root.pageType : root.level === 0 ? 'Department' : 'Category',
328
353
  meta: root => isBrand(root) ? {
329
354
  selectedFacets: [{
330
355
  key: 'brand',
331
356
  value: slugify(root.name)
332
357
  }]
333
358
  } : {
334
- selectedFacets: new URL(isPortalPageType(root) ? `https://${root.url}` : root.url).pathname.slice(1).split('/').map((segment, index) => ({
359
+ selectedFacets: new URL(isCollectionPageType(root) ? `https://${root.url}` : root.url).pathname.slice(1).split('/').map((segment, index) => ({
335
360
  key: `category-${index + 1}`,
336
361
  value: slugify(segment)
337
362
  }))
338
363
  },
339
364
  breadcrumbList: async (root, _, ctx) => {
340
365
  const {
341
- clients: {
342
- commerce
366
+ loaders: {
367
+ collectionLoader
343
368
  }
344
369
  } = ctx;
345
370
  const slug = slugify$1(root);
@@ -352,14 +377,14 @@ const StoreCollection = {
352
377
 
353
378
  const segments = slug.split('/').filter(segment => Boolean(segment));
354
379
  const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
355
- const pageTypes = await Promise.all(slugs.map(s => commerce.catalog.portal.pagetype(s)));
380
+ const collections = await Promise.all(slugs.map(s => collectionLoader.load(s)));
356
381
  return {
357
- itemListElement: pageTypes.map((pageType, index) => ({
358
- item: new URL(`https://${pageType.url}`).pathname.toLowerCase(),
359
- name: pageType.name,
382
+ itemListElement: collections.map((collection, index) => ({
383
+ item: new URL(`https://${collection.url}`).pathname.toLowerCase(),
384
+ name: collection.name,
360
385
  position: index + 1
361
386
  })),
362
- numberOfItems: pageTypes.length
387
+ numberOfItems: collections.length
363
388
  };
364
389
  }
365
390
  };
@@ -720,7 +745,13 @@ const StoreProduct = {
720
745
  },
721
746
  isVariantOf: ({
722
747
  isVariantOf
723
- }) => isVariantOf
748
+ }) => isVariantOf,
749
+ additionalProperty: ({
750
+ attributes = []
751
+ }) => attributes.map(attribute => ({
752
+ name: attribute.key,
753
+ value: attribute.value
754
+ }))
724
755
  };
725
756
 
726
757
  const StoreProductGroup = {
@@ -730,7 +761,17 @@ const StoreProductGroup = {
730
761
  }) => product,
731
762
  name: ({
732
763
  name
733
- }) => name
764
+ }) => name,
765
+ additionalProperty: ({
766
+ textAttributes = [],
767
+ productSpecifications = []
768
+ }) => {
769
+ const specs = new Set(productSpecifications);
770
+ return textAttributes.filter(attribute => specs.has(attribute.labelKey)).map(attribute => ({
771
+ name: attribute.labelKey,
772
+ value: attribute.labelValue
773
+ }));
774
+ }
734
775
  };
735
776
 
736
777
  const getIdFromSlug = slug => {
@@ -801,22 +842,15 @@ const Query = {
801
842
  } = ctx;
802
843
  return skuLoader.load(locator.map(transformSelectedFacet));
803
844
  },
804
- collection: async (_, {
845
+ collection: (_, {
805
846
  slug
806
847
  }, ctx) => {
807
848
  const {
808
- clients: {
809
- commerce
849
+ loaders: {
850
+ collectionLoader
810
851
  }
811
852
  } = ctx;
812
- const result = await commerce.catalog.portal.pagetype(slug);
813
- const whitelist = ['Brand', 'Category', 'Department', 'Subcategory'];
814
-
815
- if (whitelist.includes(result.pageType)) {
816
- return result;
817
- }
818
-
819
- throw new NotFoundError(`Not Found: ${slug}`);
853
+ return collectionLoader.load(slug);
820
854
  },
821
855
  search: async (_, {
822
856
  first,
@@ -864,6 +898,7 @@ const Query = {
864
898
  endCursor: products.total.toString(),
865
899
  totalCount: products.total
866
900
  },
901
+ // after + index is bigger than after+first itself because of the array flat() above
867
902
  edges: skus.map((sku, index) => ({
868
903
  node: sku,
869
904
  cursor: (after + index).toString()
@@ -900,17 +935,18 @@ const Query = {
900
935
  const collections = [...brands.map(x => ({ ...x,
901
936
  type: 'brand'
902
937
  })), ...categories];
938
+ const validCollections = collections // Nullable slugs may cause one route to override the other
939
+ .filter(node => Boolean(StoreCollection.slug(node, null, ctx, null)));
903
940
  return {
904
941
  pageInfo: {
905
- hasNextPage: false,
906
- hasPreviousPage: false,
942
+ hasNextPage: validCollections.length - after > first,
943
+ hasPreviousPage: after > 0,
907
944
  startCursor: '0',
908
- endCursor: '0'
945
+ endCursor: (Math.min(first, validCollections.length - after) - 1).toString()
909
946
  },
910
- edges: collections // Nullable slugs may cause one route to override the other
911
- .filter(node => Boolean(StoreCollection.slug(node, null, ctx, null))).slice(after, first).map((node, index) => ({
947
+ edges: validCollections.slice(after, after + first).map((node, index) => ({
912
948
  node,
913
- cursor: index.toString()
949
+ cursor: (after + index).toString()
914
950
  }))
915
951
  };
916
952
  }
@@ -1040,11 +1076,11 @@ var doc$b = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","na
1040
1076
  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}};
1041
1077
  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}};
1042
1078
 
1043
- 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}};
1044
- 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}};
1079
+ 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}};
1080
+ 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}};
1045
1081
 
1046
- 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}};
1047
- 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}};
1082
+ 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}};
1083
+ 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}};
1048
1084
 
1049
1085
  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}};
1050
1086
  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}};
@@ -1061,7 +1097,10 @@ var doc$i = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","na
1061
1097
  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}};
1062
1098
  doc$j.loc.source = {"body":"enum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1063
1099
 
1064
- 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(graphql.print).join('\n');
1100
+ 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}};
1101
+ doc$k.loc.source = {"body":"type StorePropertyValue {\n value: String!\n name: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
1102
+
1103
+ 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(graphql.print).join('\n');
1065
1104
 
1066
1105
  const platforms = {
1067
1106
  vtex: {