Error: rpc error: code = Unavailable desc = connection error: desc = “transport: authentication handshake failed: x509: certificate is valid for *.grpc.eu-central-1.aws.cloud.dgraph.io, not nameless-brook-330378.grpc.grpc.eu-central-1.aws.cloud.dgraph.io”
conn, err := dgo.DialCloud("grpc://nameless-brook-330378.grpc.eu-central-1.aws.cloud.dgraph.io", "")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
ctx := context.Background()
client := dgo.NewDgraphClient(api.NewDgraphClient(conn))
tnx := client.NewTxn()
defer tnx.Discard(ctx)
resp, err := tnx.QueryWithVars(ctx, q, variables)
if err != nil {
log.Fatal(err)
}
log.Println(string(resp.Json))