"I knew he had a changeup," Farmer said of his last at-bat. "I knew he was going to come inside with the fastball and [after that] I knew I had to stay back on that changeup and luckily I was able to come through and help the team win."
The walk-off hit capped a big day for the catcher as he finished 2-for-5 with four RBIs.
After hitting just three home runs in 120 games during the 2015 campaign, Farmer's third-inning blast was a bit of a surprise.
"My home runs are mistakes," Farmer said. "I like to hit doubles, but I'll take a homer."
While Farmer isn't known for his power, it was his knowledge of Cubs prospect Pierce Johnson that led to the blast.
"That was a slider," Farmer said. "I knew he was going to come back to that pitch. He threw me a slider in my first at-bat and he came back to it. I got lucky I guess."
With the walk-off Farmer had the most critical hit of the day, but he wasn't the only player to have a productive play at the plate.
Astros prospect J.D. Davis and Dodgers prospect Brandon Dixon also hit homers.
"It's almost like an All-Star team," Farmer said. "[We've got] a good pitching staff, guys that can hit, it's a lot of fun."
In the other dugout, it was Athletics prospect Chad Pinder who provided the offensive fireworks.
Pinder, the A's No. 7 prospect, went 3-for-5 with two home runs and four RBIs.
The two-home run day was just the latest accomplishment in what has been a terrific year for Pinder.
The middle-infield prospect hit .317 with 15 homers and 86 RBIs in 117 games with the Midland Rockhounds and was named the Texas League Player of the Year in 2015.
William Boor is a reporter for MLB.com. Follow him on Twitter at @wboor. This story was not subject to the approval of Major League Baseball or its clubs.