Hello Dgraph community,
I started working with Dgraph few days ago. And while I prefer to work with the Go client (and the gRPC interface) I found that it’s quite tedious to work with the responses so I started working on a small helper library today and thought it might be useful to some of you.
With it you can do stuff like:
import "github.com/etix/xdgraph"
[...]
xd := xdgraph.ReadResponse(resp)
// Get the UID of the "me" attribute
xd.Attribute("me").Uid()
// Get the "name" property of the "me" attribute
xd.Attribute("me").Property("name").ToString()
// Use different types
xd.Attribute("me").Attribute("follows").Property("birthdate").ToDate()
[...]
It’s available on Github if you want to give it a try
Pull-requests are welcome!