[[rest-api-return-paths]]
=== Return paths ===

Paths can be returned
together with other return types by just
specifying returns.


[source,cypher]
----
START x  = node(%I%)
MATCH path = (x--friend)
RETURN path, friend.name
----


.Final Graph
["dot", "Final-Graph-return-paths.svg", "neoviz"]
----
  N29 [
    label = "{Node\[29\]|name = \'you\'\l}"
  ]
  N30 [
    label = "{Node\[30\]|name = \'I\'\l}"
  ]
  N30 -> N29 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "know\n"
  ]
----

_Example request_

* *+POST+*  +http://localhost:7474/db/data/cypher+
* *+Accept:+* +application/json+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{"query": "start x  = node(30) match path = (x--friend) return path, friend.name","params": {}},
----


_Example response_

* *+200:+* +OK+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{
  "columns" : [ "path", "friend.name" ],
  "data" : [ [ {
    "start" : "http://localhost:7474/db/data/node/29",
    "nodes" : [ "http://localhost:7474/db/data/node/29", "http://localhost:7474/db/data/node/30" ],
    "length" : 1,
    "relationships" : [ "http://localhost:7474/db/data/relationship/10" ],
    "end" : "http://localhost:7474/db/data/node/30"
  }, "you" ] ]
}
----


