Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dgo
✓ github.com/dgraph-io/dgo/v210
Connects to a local Dgraph instance and runs a simple query.
package main
import (
"context"
"fmt"
"log"
"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"
"google.golang.org/grpc"
)
func main() {
conn, err := grpc.Dial("localhost:9080", grpc.WithInsecure())
if err != nil {
log.Fatal(err)
}
defer conn.Close()
dc := dgo.NewDgraphClient(api.NewDgraphClient(conn))
resp, err := dc.NewTxn().Query(context.Background(), "{ me(func: has(name)) { name } }")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Response: %s\n", resp.Json)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Dependencies
No dependency data recorded yet.