You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and potentially a code change to simplify that logic in that resolver if the edge case is unreachable.
the isBrand(root) || isCollectionPageType(root) condition seems redundant, because pageType: "Brand"is already of type CollectionPage
currently, TS intellisense hints that the false branch of the ternary is only reachable when the "collection" entity being resolved is a category in the store taxonomy, and likely an N-level category because L0,L1,L2 categories get their own pageType designation. this is depicted in the screenshot below. however, the observed root shape for all levels of category in the actual API response is always the lowercase set of keys.
I know certain VTEX APIs return the PascalCase keys rather than the camelCase keys, so I'm curious if it's something specific to our store's configuration or API version that's making that more deterministic, or if this edge case handling is now archaic and can be removed.
Describe alternatives you've considered
we're overriding this logic in our own custom resolver, and having to replicate manually because the types are not exported. it would be helpful to understand if the core edge case that this handling was written for is truly deprecated so that we can at least remove it in our own override if not also simplify in the /api package.
The text was updated successfully, but these errors were encountered:
Describe the feature you'd like
I would appreciate a clarification on what edge case the following logic is covering:
faststore/packages/api/src/platforms/vtex/resolvers/collection.ts
Lines 38 to 41 in 8f5eb69
and potentially a code change to simplify that logic in that resolver if the edge case is unreachable.
isBrand(root) || isCollectionPageType(root)
condition seems redundant, becausepageType: "Brand"
is already of type CollectionPagepageType
designation. this is depicted in the screenshot below. however, the observedroot
shape for all levels of category in the actual API response is always the lowercase set of keys.I know certain VTEX APIs return the PascalCase keys rather than the camelCase keys, so I'm curious if it's something specific to our store's configuration or API version that's making that more deterministic, or if this edge case handling is now archaic and can be removed.
Describe alternatives you've considered
we're overriding this logic in our own custom resolver, and having to replicate manually because the types are not exported. it would be helpful to understand if the core edge case that this handling was written for is truly deprecated so that we can at least remove it in our own override if not also simplify in the
/api
package.The text was updated successfully, but these errors were encountered: