Quick Introduction
dqlx is a fully featured Dgraph Schema and Query Builder for Go.
It aims to simplify the interaction with the awesome Dgraph database allowing you to
fluently compose any queries and mutations of any complexity. It also comes with a rich Schema builder
to easily develop and maintain your Dgraph schema.
#
Installation#
ConnectingOnce we installed the library we can quickly connect to a DGraph Cluster
#
Inserting DataAt this point we should be successfully connected to the cluster. Let's add some data so that we can query it later.
#
Querying DataNow that we have some data to work with, let's write some queries!
We are going to have the following criterias in our query:
- Must be a Cat
- Younger than 5 years old
Spoiler: We should be getting back only Ollie!
#
The Final ScriptWhen putting all our code together, we'll get this lovely program:
Congratulations!
You now have the basics to deep dive into the various aspects of the Queries & Mutations.