Moved from GitHub dgo/83
Posted by jawr:
Quite possibly another version mismatch issue, but I am not getting results back for a query (upsert blocks are working), and querying from ratel works.
docker image: dgraph:v1.1.0-rc2
dgo: v2.0.0-rc1 h1:753hWclPX4U+enGF0P+otArveffRAde1pm3prJ6gbxE=
code:
query := fmt.Sprintf(`{ nameserver(func: eq(nameserver.name, %q)) { uid } }`, name)
tx := p.client.NewReadOnlyTxn().BestEffort()
defer tx.Discard(ctx)
resp, err := tx.Query(ctx, query)
if err != nil {
return "", errors.Wrap(err, "Query")
}
log.Printf("query: %s, resp: %+v", query, resp)
output:
2019/08/26 08:01:12 query: { nameserver(func: eq(nameserver.name, "ns.buydomains.com")) { uid } }, resp: json:"{\"nameserver\":[]}" txn:<start_ts:1721348 > latency:<parsing_ns:5585 processing_ns:224733 encoding_ns:2963 >
Running the query in ratel works as expected:
{
"data": {
"nameserver": [
{
"uid": "0xe72c66"
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 23370,
"processing_ns": 3643589,
"encoding_ns": 11415,
"assign_timestamp_ns": 1320425
},
"txn": {
"start_ts": 1721601
}
}
}