Dgraph-js get mutation result from transaction

I’m happily able to perform mutations through dgraph-js, but I’d like to get the response after adding a new node (in particular the generated uid). Where and how am I supposed to do this?

        const txn = this.dgraphClient.newTxn();
        try {
            const mu: Mutation = new dgraph.Mutation();
            await txn.mutate(mu);
            await txn.commit();
        } catch(e) {
        } finally {
            await txn.discard();

Hey, try

update: Here a example

Other example

1 Like

Oh my god how did I miss that? I think I need some sleep. Thanks again michel

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.