diff --git a/src/Importer.php b/src/Importer.php
index 600ed5c..f202b8a 100644
--- a/src/Importer.php
+++ b/src/Importer.php
@@ -157,21 +157,13 @@ class Importer implements ImporterInterface {
           // Create a vertex for the graph.
           $vertex = $this->getVertex($item_uuid);
           $this->graph[$vertex->id]['edges'] = [];
-          if (empty($decoded['_embedded'])) {
-            // No dependencies to resolve.
-            continue;
-          }
-          // Here we need to resolve our dependencies:
-          foreach ($decoded['_embedded'] as $embedded) {
-            foreach ($embedded as $item) {
-              $uuid = $item['uuid'][0]['value'];
-              $edge = $this->getVertex($uuid);
-              $this->graph[$vertex->id]['edges'][$edge->id] = TRUE;
-            }
+          if (!empty($decoded['_embedded'])) {
+            $this->addEmbeddedToGraph($decoded, $vertex);
           }
         }
       }
 
+
       // @todo what if no dependencies?
       $sorted = $this->sortTree($this->graph);
       foreach ($sorted as $link => $details) {
@@ -255,4 +247,26 @@ class Importer implements ImporterInterface {
     return $this->vertexes[$item_link];
   }
 
+  /**
+   * Traverses embedded resources to add them to the dependency graph.
+   *
+   * @param array $decoded
+   *   The decoded content with embedded resources in the _embedded key.
+   * @param object $vertex
+   *   The vertex object.
+   */
+  protected function addEmbeddedToGraph($decoded, $vertex) {
+    foreach ($decoded['_embedded'] as $embedded) {
+      foreach ($embedded as $item) {
+        $uuid = $item['uuid'][0]['value'];
+        $edge = $this->getVertex($uuid);
+        $this->graph[$vertex->id]['edges'][$edge->id] = TRUE;
+
+        if (!empty($item['_embedded'])) {
+          $this->addEmbeddedToGraph($item, $vertex);
+        }
+      }
+    }
+  }
+
 }
