title: Why does my apoc.refactor.cloneNodes call iterate and create clones for every node in graph?
body: <p>I intended to clone a single node and its 3 connections, but ended up with multiple clones.</p>
  
  <p>By first MATCHing the entire graph of primary node and related nodes, when I call apoc.refactor.cloneNodes, it seems to iterate over each related node instead of just the primary node I want to clone. Result is the original primary node and 3 clones (instead of the intended 1 clone) connected to the expected related nodes.</p>
  
  <p>. . .</p>
  
  <p>I created this toy graph:</p>
  
  <pre><code>create (a:Node {description:"Spider Man Series"})
  create (b:Node {description:"Spidey"})
  create (c:Node {description:"Doc Oc"})
  create (d:Node {description:"Venom"})
  create (a)-[:BELONGS]-&gt;(b)
  create (a)-[:BELONGS]-&gt;(c)
  create (a)-[:BELONGS]-&gt;(d)
  return a,b,c,d
  </code></pre>
  
  <p>I want to clone "Spider Man Series" (and its relationships):</p>
  
  <pre><code>match (a)-[c]-(b)
  where a.description="Spider Man Series"
  call apoc.refactor.cloneNodes([a],true) yield output
  return a,b,c, output
  </code></pre>
  
  <p>But this creates 3 clones (one for each related character node). I'm guessing it has to do something with the MATCH having a relationship.</p>
  
  <p>Because if I just limit my MATCH with no relationships, I get the proper clone behavior (the original "Spider Man Series" and the clone "Spider Man Series" with cloned relationships). <strong>I'm confused because there's only 1 node that results from the WHERE clause which is stored in (a).</strong></p>
  
  <pre><code>match (a)
  where a.description="Spider Man Series"
  call apoc.refactor.cloneNodes([a],true) yield output
  return a,output
  </code></pre>
  
  <p>. . .</p>
  
  <p>I tried limiting the related nodes to 2 instead of everything "Spider Man Series" was connected to, but this ALSO gave me a clone for each related node:</p>
  
  <pre><code>match (a)-[c]-(b)
  where a.description="Spider Man Series" and b.description in ['Spidey','Venom']
  call apoc.refactor.cloneNodes([a],true) yield output
  return a,b,c, output
  </code></pre>