title: Cypher query to 'expand' around a path of nodes
body: <p>I have two cypher queries that behave as expected.  My graph simply consists of businesses connected by relationships.</p>
  
  <pre><code># Finding the shortest path that exists between two given business nodes
  START a=node:Businesses('id: xxx'), b=node:Businesses('id: yyy')
  MATCH a, b, p= shortestPath((a)-[*..15]-(b))
  RETURN p
  
  # Find all nodes connected 1-step out from a given business node
  START a=node:Businesses('id: xxx')
  MATCH (a)-[r:isRelated*]-&gt;(d)
  RETURN distinct d,r
  </code></pre>
  
  <p>I now want to combine aspects of these two queries into one.  I want to find the shortest path between any two given nodes AND go 1-step out from the nodes in the returned path.  I've tried the query below which doesn't work because p is returning a path and my second match statement is expecting a node.</p>
  
  <pre><code>START a=node:Businesses('id: xxx'), b=node:Businesses('id: yyy')
  MATCH a, b, p= allShortestPaths((a)-[*..15]-(b))
  WITH p
  MATCH (p)-[r:isRelated*1]-&gt;(d)
  RETURN distinct p,d,r
  </code></pre>
  
  <p>How should I go about writing this type of query?</p>