Can I update fields with the @id directive?

You have two inputs, just input one object with exactly what you want.

{
  "uid": $input.userId
  "email": $input.email
  "role": {
    roleId: $input.roleId
  }
}

or whatever it may be…

J