Struggling to get a mutation to work in 0.9 using HTTP, I have a feeling that everything is going into a transaction (which I may have inadvertently created when I first started a server), but I’ve restarted the server and dropped the DB so I would be surprised if the transaction is still open.
-
Start with a clean build (not attaching a data volume in case that leaves something behind)
docker rm diggy
…
docker run -it -p 8080:8080 -p 9080:9080 --name diggy dgraph/dgraph dgraph zero --port_offset -2000
…
docker exec -it diggy dgraph server --memory_mb 2048 --zero localhost:5080
…
localhost:8080/alter -> {"drop_all": true} -
Add a schema
localhost:8080/alter -> name: string @index(term) . -
Add Bob and Alice
localhost:8080/mutate
{
set {
<_:bob> <name> "Bob" .
<_:bob> <balance> "70" .
<_:alice> <name> "Alice" .
<_:alice> <balance> "100" .
}
}
{
"data": {
"code": "Success",
"message": "Done",
"uids": {
"alice": "0x2",
"bob": "0x1"
}
},
"extensions": {
"txn": {
"start_ts": 2,
"keys": [
"AAAHYmFsYW5jZQAAAAAAAAAAAg==",
"AAAHYmFsYW5jZQAAAAAAAAAAAQ==",
"AAAEbmFtZQAAAAAAAAAAAg==",
"AAAEbmFtZQAAAAAAAAAAAQ==",
"AAAEbmFtZQIBYWxpY2U=",
"AAAEbmFtZQIBYm9i",
"AAALX3ByZWRpY2F0ZV8AAAAAAAAAAAI=",
"AAALX3ByZWRpY2F0ZV8AAAAAAAAAAAI=",
"AAALX3ByZWRpY2F0ZV8AAAAAAAAAAAE=",
"AAALX3ByZWRpY2F0ZV8AAAAAAAAAAAE="
],
"lin_read": {
"ids": {
"1": 11
}
}
}
}
}
- Query for bob and alice (seems like the mutation hasn’t been committed…)?
{
balances(func: allofterms(name@en, "Alice")) {
uid
name
balance
}
}
{
"data": {
"balances": []
},
"extensions": {
"server_latency": {
"parsing_ns": 21874,
"processing_ns": 193677,
"encoding_ns": 1124903
},
"txn": {
"start_ts": 3,
"lin_read": {
"ids": {
"1": 13
}
}
}
}
}
I’ve not sent any headers on any of this.