Can I update fields with the @id directive?

You’re passing set as a string when you use ``

Try just:

const dqlUpdate = await dql.mutate({
  set {
    "uid": $id,
    "email": $email,
    "role": {
      "id": $roleId
    }
});

J