Dgraph unique identifier

Moved from GitHub dgraph-js/102

Posted by xSequential:

I am using dgraph with an apollo server in front of it. In Apollo I plan to maintain a unique identifier for each user in my dgraph db.

Is the UID appropriate for this identifier?

If so, how do I grab it from the response from txn.commit? I would need to return it for feedback to my apollo server. Is there any feedback from the dgraph server?

xSequential commented :

Nevermind, I found it from the examples minutes later:

mu.setSetJson({
  uid: `_:${some_unique_value}`,
  ...stuff
})

const response = await txn.mutate(mu);

const uid = response.getUidsMap().get(some_unique_value);

May want to add to the README