I’ve been able to add, but I was using JS Object format.
addGame = {
"uid" : "_:newNode",
"Game.prize": 100,
"dgraph.type": "Game"
}
txn = client.txn()
res = txn.mutate(set_obj=addState)
txn.commit()
txn.discard()
client_stub.close()
When I try to change things though, is where I run into issues.
(But I think I figured it out based on your example, see below)
One thing I find confusing is the inconsistent use of JS Object format and RDF in the docs. It would be nice if all examples had both. I was using JS Object exclusively, but then started using RDF as that’s what more of the examples were showing.
This was my code
try:
txn = client.txn()
mutation = txn.create_mutation(set_nquads='<0x1fbd2> <prize> "15" .')
request = txn.create_request(query=query, mutations=[mutation], commit_now=True)
print(txn.do_request(request))
except Exception as e:
print(e)
finally:
txn.discard()
client_stub.close()
I tried doing <Game.prize> and that solved my problem (based on you specifying type in your examples). The examples don’t make this clear.
I’ve spent so much time on this and then the tour not working, yet it was a very simple change. Was losing my mind.
What is that period at the end of the statements?