I’m using the dgo client library.
Tried querying schema with gRpc connection with this code:
schemaQuery := `
schema {
type
index
reverse
tokenizer
list
count
upsert
lang
}
`
tx := c.NewTxn()
resp, err := tx.Query(context.Background(), schemaQuery)
if err != nil {
return nil, err
}
var queryResult struct {
Data []Schema
}
log.Println((string(resp.Json))
All it logs is just an empty object {}
.
Tried querying using HTTP, seems to return schema as normal.
~$ curl -X POST localhost:8080/query -d $'
schema {
type
index
reverse
tokenizer
list
count
upsert
lang
}' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 409 100 346 100 63 5792 1054 --:--:-- --:--:-- --:--:-- 5965
{
"data": {
"schema": [
{
"predicate": "_predicate_",
"type": "string",
"list": true
},
{
"predicate": "email",
"type": "string",
"index": true,
"tokenizer": [
"hash"
]
},
{
"predicate": "password",
"type": "string"
},
{
"predicate": "username",
"type": "string",
"index": true,
"tokenizer": [
"hash"
]
}
]
},
"extensions": {
"server_latency": {
"encoding_ns": 1777000
},
"txn": {
"start_ts": 30036
}
}
}
Any issue with the gRpc client?