Sign in to Hypermode and create your workspace
hypermode.com/login in your web browser and sign
in to Hypermode to create your account.After signing in youβll be prompted to choose a name for your workspace.
Enter a name for your workspace and then select Create workspace.Create your graph
Enter a name for your graph and choose the hosting location, then select
Create graph.View your graph details
Weβll use the Dgraph connection string and the API key to connect to our graph
via Dgraph clients such as Ratel or language SDKs.Click on the copy icon next to the connection string to copy the Dgraph
connection string.Connect the Ratel graph client
The Ratel console is where we can execute DQL queries and mutations and view the
results of these operations, including visualizing graph data.
Now weβre ready to add data to our graph.
Add mutation in Ratel
View mutation results
Query for all movies
Movie nodes as the start of the traversal using
the type(Movie) function to define the starting point of our query traversal,
then finds any genres, directors, and characters connected to each movie.View results in JSON and graph visualization

type() function to find the starting point of our
graph traversal. We can use more complex functions to filter by string
comparison operator, and others, however to use these function we must first
update the graph schema to create an index on the predicates we want to use in
these functions.
The function documentation specifies which kind of
index is needed for each function.
Weβll use Ratel to alter the schema to add indexes on some of the data so
queries can use term matching, filtering, and sorting.
Create an index for movie title
Movie.title predicate. Ratel displays details about the predicate
type and indexes.Change the type to string then select index and select term for the
Movie.title predicate, then select Update to apply the index.
Create an index for movie release date
Movie.release_date predicate.Select the Movie.release_date predicate. Change the type to dateTime.
Select index and choose year for the index tokenizer. Click Update
to apply the index on the release-date predicate.
Query using indexes
Try changing the release date and the search terms conditions to see Dgraph
search and filtering in action.Add reverse relationship
Movie.genre predicate as a reverse relationship.To define a reverse relationship for the Movie.genre predicate weβll return to
the Schema page in Ratel, select the Movie.genre predicate and toggle the
reverse checkbox. Then select Update to apply this schema change.
Query using the reverse relationship
~ operator is used to specify a reverse relationship. To
traverse from a genre node to a movie node we use the syntax ~Movie.genre.In this query we find all movies connected to the βSci-Fiβ genre:movies: ~Movie.genre.