lotas / contentful-graph

Visual representation of contentful content models in form of graphs
https://www.contentful.com/blog/2017/08/08/how-to-quickly-visualize-your-content-model/
MIT License
59 stars 6 forks source link

Doesn't map out all relations #30

Open nabati opened 3 years ago

nabati commented 3 years ago

Not sure how I should capture a good repro for this, but I noticed that many but not all relations are mapped out by this utility. Some of our content types just end up without relationships with any other content-types (but they for sure have relationships with other types).

How do you suggest we proceed?

How can I give a better repro without sharing the entire data for the contentful space?

lotas commented 3 years ago

Hi @nabati, thanks for the issue. It would be good to see what happens for those unmapped entities. Would you be able to see in the entity definition how it is being linked?

nabati commented 3 years ago
digraph obj {
  node[shape=record];

  "componentUpsell";
  "metaContent";
  "variant";
  "Asset";
  "componentProductGridNew";
  "subcategoryPage";
  "categoryPage";
  "faqEntry";
  "faqPage";
  "imageCarousel";
  "uspCard";
  "pageDesigner";
  "componentImageCarouselNew";
  "pageHomepageNew";
  "componentFaqEntryGlobal";
  "test";
  "pageCollection";
  "imageEntry";
  "brandModuleProductGrid";
  "faqCategory";
  "pageTextPageGlobal";
  "textPage";
  "audience";
  "blockQuote";
  "departmentPage";
  "featureModule";
  "twelveColumnModuleRow";
  "componentHeroModule";
  "articlesPage";
  "pageOurDesigners";
  "componentNavigation";
  "link";
  "articlePage";
  "productMaterialSample";
  "componentArticlePreview";
  "componentProductCard";
  "promotionCard";
  "linkTag";
  "lifestyle";
  "editorial";
  "brandModuleProductGridItem";
  "imageRow";
  "eightPlusFourRow";
  "lifestyleImage";
  "footer";
  "paragraph";
  "brandModuleTextBlock";

  edge [color="#e6194B"];
  "componentUpsell" -> "variant" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "variant" -> "Asset" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "componentProductGridNew" -> "variant" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "subcategoryPage" -> "variant" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "subcategoryPage" -> "variant" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "categoryPage" -> "variant" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "categoryPage" -> "subcategoryPage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "faqEntry" -> "componentFaqEntryGlobal" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "faqPage" -> "componentFaqEntryGlobal" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "faqPage" -> "faqCategory" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "imageCarousel" -> "Asset" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "componentImageCarouselNew" -> "imageEntry" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "test" -> "variant" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "test" -> "subcategoryPage" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "test" -> "uspCard" [dir=forward,label="0..*"];
  edge [color="#4363d8"];
  "test" -> "test" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "pageCollection" -> "variant" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "brandModuleProductGrid" -> "brandModuleProductGridItem" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "faqCategory" -> "componentFaqEntryGlobal" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "departmentPage" -> "categoryPage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "twelveColumnModuleRow" -> "componentHeroModule" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "twelveColumnModuleRow" -> "lifestyle" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "twelveColumnModuleRow" -> "brandModuleProductGrid" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "twelveColumnModuleRow" -> "brandModuleTextBlock" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "articlesPage" -> "articlePage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "pageOurDesigners" -> "pageDesigner" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "componentNavigation" -> "categoryPage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "componentNavigation" -> "departmentPage" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "componentNavigation" -> "link" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "componentNavigation" -> "articlesPage" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "componentNavigation" -> "categoryPage" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "componentNavigation" -> "faqPage" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "componentNavigation" -> "textPage" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "componentNavigation" -> "link" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "componentNavigation" -> "articlesPage" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "componentNavigation" -> "categoryPage" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "componentNavigation" -> "departmentPage" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "componentNavigation" -> "faqPage" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "componentNavigation" -> "subcategoryPage" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "componentNavigation" -> "textPage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "articlePage" -> "blockQuote" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "articlePage" -> "imageCarousel" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "articlePage" -> "imageRow" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "articlePage" -> "paragraph" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "articlePage" -> "[ Unknown type: portraitImageRow ]" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "articlePage" -> "variant" [dir=forward,label="0..*"];
  edge [color="#ffe119"];
  "articlePage" -> "subcategoryPage" [dir=forward,label="0..*"];
  edge [color="#4363d8"];
  "articlePage" -> "articlePage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "linkTag" -> "categoryPage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "linkTag" -> "subcategoryPage" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "linkTag" -> "variant" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "lifestyle" -> "linkTag" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "lifestyle" -> "linkTag" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "imageRow" -> "Asset" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "eightPlusFourRow" -> "editorial" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "eightPlusFourRow" -> "lifestyle" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "eightPlusFourRow" -> "editorial" [dir=forward,label="0..*"];
  edge [color="#3cb44b"];
  "eightPlusFourRow" -> "featureModule" [dir=forward,label="0..*"];
  edge [color="#e6194B"];
  "lifestyleImage" -> "variant" [dir=forward,label="0..*"];
}

graphviz (3)

Several of the nodes on the right should have links to other elements, but they do not here. Not sure what the issue could be?

lotas commented 3 years ago

hi @nabati, thanks. So according to the raw dot object you provided, it the graph is fine. Can you please tell at least one node that doesn't contain links, so we could continue our investigation there?

I would also likely ask you to give some details for the original schema for those models if possible, to see how the relations are defined there. Maybe they are not defined at all, or are defined in some other way.

Thanks!

Swissbite commented 3 years ago

@nabati I encountered the same problems several versions of ago. So, my questions would be: