Former Texas congressman Beto O'Rourke speaks during the first night of the Democratic presidential debate on June 26, 2019 in Miami, Florida.

A handful of Democratic presidential candidates tore into President Donald Trump's trade war with China during the first round of primary debates this week.

While trade received scant attention during the debates Wednesday and Thursday — only one question was asked that specifically included the word, China was cited repeatedly during both nights as one of the greatest geopolitical threats to the U.S. And South Bend, Indiana, Mayor Pete Buttigieg, former Texas Rep. Beto O'Rourke, Colorado Sen. Michael Bennet and entrepreneur Andrew Yang all managed to work their trade war critiques into the conversation.

"The tariffs and the trade war are just punishing businesses and producers and workers on both sides," Yang said. "We need to crack down on Chinese malfeasance in the trade relationship, but the tariffs and the trade war are the wrong way to go."

The attacks from Trump's potential challengers in the 2020 election came on the eve of his high-stakes meeting with Chinese President Xi Jinping on Saturday at the G-20 summit in Osaka, Japan.

Trump's current and former advisors anticipate that the meeting could revive the stalled negotiations between the two economic superpowers over a sweeping trade deal. The U.S. says a deal should address Beijing's alleged theft of intellectual property and forced technology transfers. A White House official told CNBC on Friday morning that Trump wouldn't need huge concessions in order to at least strike a truce in the tit-for-tat trade war.

But Trump has also recently threatened to levy $300 billion in additional tariffs on Chinese goods on top of the duties of $250 billion already imposed, and has long held hard-line protectionist views on trade.

Buttigieg said China's challenge to the U.S. "is not something to dismiss or wave away." But, he added that its fundamental economic model isn't going to change because of some tariffs.

"Folks who aren't in the shadow of a factory are somewhere near a soy field where I live. And manufacturers, and especially soy farmers, are hurting," Buttigieg said. "Tariffs are taxes. And Americans are going to pay on average $800 more a year because of these tariffs."

Bennet took a similar tack, saying, "In China, I think the president's been right to push back on China but he's done it in completely the wrong way."

"We should mobilize the entire rest of the world who all have a shared interest in pushing back on China's mercantilist trade policies and I think we can do that," Bennet said.

All of the candidates who weighed in during the debates signaled strong opposition to Trump's protectionist policies. But the Democratic field is hardly a solid bloc of free-traders: An analysis of the candidates by the Peterson Institute for International Economics in March found that the contenders "offer widely different perspectives on U.S. trade policy, and thus on U.S. engagement with the world in a post-Trump era."

O'Rourke, who has taken a harder stance against the trade war than most other Democratic candidates, brought the issue up without prompting.

Asked about what he would tell voters skeptical of his broad plans for government reform, O'Rourke said "I think you've got to bring everybody in to the decisions and the solutions, to the challenges that we face."

"We were in Pacific Junction, a town that had never meaningly flooded before, just up against the Missouri River in Iowa, and every home in that community had flooded. There were farms just outside of Pacific Junction that were effectively lakes. Those farmers already underwater in debt. Their markets closed to them by a trade war under this administration," O'Rourke said. "Now they don't know what to do."