New York CNN  — 

Inflation-fatigued shoppers are heading to Walmart for groceries while they’re pulling back on nonessential purchases at other chains.

Walmart (WMT), America’s largest retailer, posted strong sales last quarter and raised its outlook for 2023.

The company said Thursday that sales at stores open for at least one year increased 7.4% during its latest quarter compared with the same stretch last year. Its operating income increased 17.3% last quarter.

Walmart (WMT) raised its sales forecast for its next quarter and the full-year, sending its stock up 1.5% during pre-market trading.

During times of economic strains, Walmart tends to perform best.

The company can reach a wide swath of shoppers, and around half of its sales come from groceries and other non-discretionary products.

Walmart’s grocery sales increased by low double-digits last quarter, the company said. Food prices have climbed in recent years, and Walmart said wealthier households have been shopping in its stores more frequently. Other shoppers are trading down into Walmart’s cheaper private-label food brands to save money.

“Customers continue to seek value given the impact of inflation,” Walmart CEO Doug McMillon said on a call with analysts.

The company said sales of discretionary products, such as home goods, electronics and clothing, were sluggish.

The retailer’s strong results contrast with Target (TGT) and Home Depot’s (HD) weaker figures during their latest quarters.

Shoppers have pulled back from these chains on discretionary purchases as they face pressure from higher prices and borrowing costs.