-- @param {String} $1:id The id of the task for which to toggle the favorite status
-- @param {String} $2:userId The id of the user to whome the contact belongs

UPDATE "Contact"
SET favorite = not favorite
WHERE id = $1 and "userId" = $2
RETURNING *