Can I update fields with the @id directive?

I have tried

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

but I get the error that $id is not defined