title: neo4j multiple match merge making relationships fail
body: <p>I have node types a,b,c where each type can have 1 or more of every type (including its own type). In one transaction I MERGE all of the nodes from a file, then in the next transaction I MATCH nodes and try to create their relationships. </p>
  
  <p><a href="https://i.stack.imgur.com/K4s2y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K4s2y.png" alt="enter image description here"></a></p>
  
  <p>The following cypher statement succeeds with no failures, but also does not create the relationships I expect:</p>
  
  <pre><code>MATCH(a:TypeA) WHERE a.name = {nameA}
  MATCH(b:TypeB) WHERE b.name = {nameB}
  MATCH(c:TypeC) WHERE c.name = {nameC}
  MATCH(d:TypeA) WHERE d.name = {nameD}
  MERGE(a)-[:has_a]-&gt;(d)
  MERGE(a)-[:has_b]-&gt;(b)
  MERGE(a)-[:has_c]-&gt;(c)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/QFYEI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QFYEI.png" alt="enter image description here"></a></p>
  
  <p>If I narrow down the above cypher statement to the first match, any of the other matches, and a single relationship merge it works as expected such as:</p>
  
  <pre><code>MATCH(a:TypeA) WHERE a.name = {nameA}
  MATCH(b:TypeB) WHERE b.name = {nameB}
  MERGE(a)-[:has_b]-&gt;(b)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/77iQl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/77iQl.png" alt="enter image description here"></a></p>
  
  <p>Is there a cypher format or limitation I am not aware of?</p>