Skip to content

Commit

Permalink
fix: Add missing Catalog pageTypes to @faststore/api (#1411)
Browse files Browse the repository at this point in the history
* Add missing Catalog pageTypes to @faststore/api

- `SubCategory`
- `Collection`
- `Cluster`

* Update docs on StoreCollectionType
  • Loading branch information
victorhmp authored Jul 20, 2022
1 parent acf0843 commit e74890b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ export interface CollectionPageType {
url: string
title: string
metaTagDescription: string
pageType: 'Brand' | 'Category' | 'Department' | 'Subcategory' | 'Product'
pageType:
| 'Brand'
| 'Category'
| 'Department'
| 'SubCategory'
| 'Product'
| 'Collection'
| 'Cluster'
}

export interface FallbackPageType {
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/platforms/vtex/loaders/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const collectionPageTypes = new Set([
'category',
'department',
'subcategory',
'collection',
'cluster',
] as const)

export const isCollectionPageType = (x: any): x is CollectionPageType =>
Expand Down
10 changes: 9 additions & 1 deletion packages/api/src/typeDefs/collection.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Product collection type. Possible values are `Department`, `Category`, `Brand` or `Cluster`.
Product collection type. Possible values are `Department`, `Category`, `Brand`, `Cluster`, `SubCategory` or `Collection`.
"""
enum StoreCollectionType {
"""
Expand All @@ -11,13 +11,21 @@ enum StoreCollectionType {
"""
Category
"""
Third level of product categorization.
"""
SubCategory
"""
Product brand.
"""
Brand
"""
Product cluster.
"""
Cluster
"""
Product collection.
"""
Collection
}

"""
Expand Down

1 comment on commit e74890b

@vercel
Copy link

@vercel vercel bot commented on e74890b Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.