Sen. Lindsey O. Graham (R-S.C.), right, with Sen. Richard J. Durbin (D-Ill.). (Manuel Balce Ceneta/AP)

LARGE MAJORITIES of Americans in both parties favor a deal to provide protection and legal status for “dreamers,” the young undocumented immigrants brought to the United States as children. That should give Congress license to make a deal — and ignore President Trump.

Where it concerns Deferred Action for Childhood Arrivals (DACA), the Obama-era program that shields dreamers from deportation, the president is pure impediment. Mercurial, malleable and malevolent, he has shifted gears, tone and stances on the program so many times that heeding him is like indulging a toddler’s caprices.

Better for lawmakers to forge a bipartisan deal and send it to the White House. Fortunately, they already have the outlines of one at hand.

That’s the pact struck by a bipartisan group of senators, including Lindsey O. Graham (R-S.C.) and Richard J. Durbin (D-Ill.), who presented it to the president last week. The deal has plenty for both sides to dislike, and it omits most of the items on their wish lists; in other words, it’s a compromise. But it would grant most dreamers eventual citizenship and appropriate $2.7 billion in the fiscal year starting this fall for beefed-up border security, more than half of it for Mr. Trump’s “beautiful” wall — the one he said Mexico would pay for.

This “dream deal” is not, and cannot be, all things to all people. Its limited purpose is to resolve an immediate problem triggered by Mr. Trump when he announced the dismantling of DACA last fall, starting March 5. In doing so, the president himself urged Congress to resolve the dreamers’ status.

Senators from both parties commented on a variety pressing issues on Jan. 16. (Jordan Frasier/The Washington Post)

The time to act is now, notwithstanding the administration’s decision to obey a court order last week ordering the government to resume accepting renewal applications from DACA recipients while legal challenges play out. (The administration announced Tuesday that it would appeal the judge’s order directly to the Supreme Court.) And the blueprint devised by Mr. Graham and Mr. Durbin is fair.

In addition to protecting dreamers, and jump-starting the border wall and funding other security measures (including surveillance technology and retaining Border Patrol agents), the deal would reshape and shrink the diversity lottery system that Mr. Trump and some other Republicans dislike. Half that program’s current 55,000 visas would be meted out according to a merit-based system to underrepresented countries. The other half would be reallocated to foreign nationals who have been living legally in the United States for years with temporary protected status, which the Trump administration has ordered ended for citizens of Haiti, El Salvador and Nicaragua.

Both sides would doubtless love to ornament that skeletal deal with their favorite immigration baubles — in the Democrats’ case, legal status or citizenship for about 11 million undocumented immigrants; in the Republicans’, an end to so-called chain migration (family reunification) visas, a feature of immigration law for decades. Mr. Trump is reported to have demanded billions of dollars more for his wall.

But why choke on a full loaf when half a loaf will do? In the Graham-Durbin deal, Congress has the makings of success. It should vote on it.