Skip to content

Can't run multiple mutations in same transaction #113

@benwerner01

Description

@benwerner01

I'm trying to run multiple mutations in the same transaction. To my understanding something like this should work:

runMutations = async (mutations: DGraphJS.Mutation[]): Promise<DGraphJS.Response> => {
    const txn = this.client.newTxn();
    try {
      const req = new DGraphJS.Request();
      req.setCommitNow(true);
      req.setMutationsList(mutations);

      return txn.doRequest(req);
    } finally {
      await txn.discard();
    }
  }

However this throws the following error:

StartTs cannot be zero while committing a transaction

What's weird to me is all of the mutations work when using this function. Is this error a bug, or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions