[[rest-api-send-a-query]]
=== Send a Query ===

A simple query returning all nodes connected to node 1, returning the
node and the name property, if it exists, otherwise `null`:


[source,cypher]
----
START x  = node(210)
MATCH x -[r]-> n
RETURN type(r), n.name?, n.age?
----


.Final Graph
["dot", "Final-Graph-Send-a-Query.svg", "neoviz"]
----
  N208 [
    label = "{Node\[208\]|name = \'you\'\l}"
  ]
  N209 [
    label = "{Node\[209\]|age = 25\lname = \'him\'\l}"
  ]
  N210 [
    label = "{Node\[210\]|name = \'I\'\l}"
  ]
  N210 -> N209 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "know\n"
  ]
  N210 -> N208 [
    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(210) match x -[r]-> n return type(r), n.name?, n.age?","params": {}},
----


_Example response_

* *+200:+* +OK+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{
  "data" : [ [ "know", "him", 25 ], [ "know", "you", null ] ],
  "columns" : [ "type(r)", "n.name?", "n.age?" ]
}
----


