Multiple re-renders due to decorators that fetch data using Apollo #142
Labels
bug
For issues that describe a defect or regression in the released software
Milestone
Issue
The decorators,
withTag
withCatalogItems
specifically on the tag page, cause the component to rerender twice. This isn't a huge issue in itself; however, add tracking and now we get multiple duplicate events triggered in Segment with different data.First, the data comes in with all of the products for the page without filtering, then the second event has the list with the filtering by tag.
Question
Should we start considering ways to combine queries for data for into a single query? This would be more in the spirit of GraphQL by making one request for everything we need for a page. Though, it would mean more bespoke queries that may only have a single
Reproduction
Product List Viewed
events being fired, once with all products, once with only the products for that tag page (if you have your data set up in a way that has many products in many tags)The text was updated successfully, but these errors were encountered: