Hello World


For the following queries to run, you should have loaded data in the introduction.

Let’s have a look at a hello world query in GraphQL+-.

Every query has a name, and the result is labelled with the same name.

The search criteria func: ... matches nodes. Function eq does what you’d expect, matching nodes with a name equalling “Michael”. The result is the matched nodes and listed outgoing edges from those nodes.

Dgraph identifies each node with a unique internal id, it’s UID — it’s not an edge, but can be returned in a query with uid. If you already know a node’s UID, it can be retrieved with func: uid(<uid-number>).

Something to try : Change the query to select someone else. You can check the sample data again.

The tutorial will handle the running of the query for you, so just focus on the query text. You can also learn about posting queries or programming with Dgraph.

Endpoint: /query