diff --git a/libs/shared/lib/schema/pills/nodes/entity/SchemaListEntityPill.tsx b/libs/shared/lib/schema/pills/nodes/entity/SchemaListEntityPill.tsx
index 72b78ffb2321be0d5fd124a0da3b28b4efde6491..026c94e4a9959b6930f25c6fe9652f62989e644b 100644
--- a/libs/shared/lib/schema/pills/nodes/entity/SchemaListEntityPill.tsx
+++ b/libs/shared/lib/schema/pills/nodes/entity/SchemaListEntityPill.tsx
@@ -83,7 +83,7 @@ export const SchemaListEntityPill = React.memo(({ id, selected, data }: NodeProp
                       },
                       {} as Record<string, string>,
                     )}
-                    numberOfElements={schemaStats.nodes.stats[data.name].count}
+                    numberOfElements={schemaStats?.nodes?.stats[data.name]?.count}
                   />
                 </VisualizationTooltip>
               </div>
diff --git a/libs/shared/lib/schema/pills/nodes/relation/SchemaListRelationPill.tsx b/libs/shared/lib/schema/pills/nodes/relation/SchemaListRelationPill.tsx
index 57ce015116c0c4c2b52e398767085b9811c2622d..2755222f7b06e666e215a9281c7fd30d3d68b122 100644
--- a/libs/shared/lib/schema/pills/nodes/relation/SchemaListRelationPill.tsx
+++ b/libs/shared/lib/schema/pills/nodes/relation/SchemaListRelationPill.tsx
@@ -95,7 +95,7 @@ export const SchemaListRelationPill = React.memo(({ id, selected, data, ...props
                         : {}
                     }
                     connections={{ from: data.from, to: data.to }}
-                    numberOfElements={schemaStats.edges.stats[data.collection]?.count}
+                    numberOfElements={schemaStats?.edges?.stats[data.collection]?.count}
                   />
                 </VisualizationTooltip>
               </div>
diff --git a/libs/shared/lib/schema/schema-utils/schema-utils.ts b/libs/shared/lib/schema/schema-utils/schema-utils.ts
index 0dc0e48fc3fe6c74c9f76c0223101826108370b1..27f2abc8483001d0b198669fa3f88a16c3acdfc8 100644
--- a/libs/shared/lib/schema/schema-utils/schema-utils.ts
+++ b/libs/shared/lib/schema/schema-utils/schema-utils.ts
@@ -6,8 +6,9 @@ export class SchemaUtils {
 
     // Instantiate a directed graph that allows self loops and parallel edges
     const schemaGraphology = new SchemaGraphology({ allowSelfLoops: true });
+
     // The graph schema needs a node for each node AND edge. These need then be connected
-    if (!nodes || !edges) return schemaGraphology;
+    if (!nodes) return schemaGraphology;
 
     nodes.forEach((node) => {
       const attributes: SchemaGraphologyNode = {
@@ -23,6 +24,8 @@ export class SchemaUtils {
       schemaGraphology.addNode(node.name, attributes);
     });
 
+    if (!edges) return schemaGraphology;
+
     // The name of the edge will be name + from + to, since edge names are not unique
     edges.forEach((edge) => {
       const edgeID = [edge.name, '_', edge.from, edge.to].join(''); //ensure that all interpreted as string