Graham then made amends for his earlier miss when he put the visitors ahead in the 31st minute, and Emmanuel Ledesma struck the bar just a minute later.
Hayter equalised six minutes later, but the home side were level for just two minutes as Ledesma smashed the ball home from close range, and Lee Tomlin raced away and finished smartly two minutes before half time to give Boro a two-goal cushion.
Boro continued in the same fashion after the break and Ledesma volleyed home his second goal of the afternoon in the 47th minute to put the visitors 4-1 up.
The Argentine almost wrapped up a hat-trick soon after, but his deflected free kick was tipped behind by Marek Stech.
Graham then blazed another effort over the bar to rival his first-half miss as Boro continued to carve Yeovil open with ease.
Yeovil were unable to make a miraculous comeback as the game ebbed away, and the loss ensured they finished the bottom of the Championship.