Architecturing related Cells

I’m having a bit of trouble understanding cells and how to architect them. I have an entity (Post) with several related entities (PostLog, Comments, etc). I want to create a View Post page that display the Post, PostLogs and Comments together.

  1. Would I be looking at creating Cells for each of the entities then putting them together at the Page level, or would I be including the PostLog/Comment Cells into the Post cell? (I don’t really have a use case where I would need to reuse the Post cell)
  2. If the answer to the former approach is “put the cells together at Page level”, I want to display the title of the Post independently from the Cells. Should I create a PostName Cell that fetches only the name, or should I just make a separate query using useQuery? Creating Cells for fetching a single value seems overkill.
  1. Right, so if cell can be fetched independently, that’s the suggested way. It will only make sense to keep cells nested inside one another if there is a dependency between them. For example, you fetch PostCell and data from PostCell you pass as a variable prop to another cell.
  2. You can use a separate cell to query just the title OR you can just bundle it into the single cell which has the title + other post details. I would try to do the latter but depends on the case.

Creating Cells for fetching a single value seems overkill.

As long as you need to handle different states when fetching a value (for example show loader while fetching, show something else if there’s no data and so on), using cell would always make sense.