Costco Wholesale (COST -0.33%) has been one of the more resilient retail stocks to invest in during the pandemic, even as inflation has been problematic for businesses. Recently, however, the warehouse giant's sales have shown signs of weakness, suggesting to investors that perhaps a slowdown for the company -- and the economy as a whole -- is underway.

But here's why that might not be true, and how Costco's latest monthly sales numbers may be a little misleading.

Gasoline and foreign exchange are weighing down its comparable sales

There are many reasons shoppers go to Costco, and purchasing cheap gas is one of them. The problem, however, is that means gas prices can have a big impact on the company's overall sales growth. And with prices coming down from a year ago, that has resulted in a worse overall growth rate for the business.

The chart below shows Costco's comparable sales for April, comparing both total sales and sales when excluding the impact of foreign exchange and gasoline. And the differences aren't small:

Data source: Company filings. Chart by author.

At first glance, it may look as though the company's 1.4% growth rate is troubling for a business that a year earlier reported a comparable-sales increase of 12.6%, but that doesn't tell the whole story. Last year, the growth rate without gasoline and foreign exchange was 8.7%. Although that's still higher than the 4.3% it achieved this past month, the gap is smaller. And a bit of a slowdown isn't a surprise given rising inflation and consumers cutting back on spending.

Another positive takeaway is that at 4.3%, the growth rate is also better than the 2.6% uptick Costco reported in March.

The company has a terrific track record for continued growth

Costco's business has demonstrated some impressive resiliency over the years. Even going back a decade, the company has consistently generated positive year-over-year growth. At around 6.5%, the company's recent quarterly growth isn't far below its 10-year average:

COST Revenue (Quarterly YoY Growth) Chart

COST Revenue (Quarterly YoY Growth) data by YCharts

Given the improved April numbers, investors can rest assured that Costco looks to be in a great position to continue expanding and that even worsening economic conditions may not be enough to derail its operations.

Is Costco stock a buy today?

For long-term investors, it's hard to not like Costco's stock. It has been a growth beast over the years. Although it trades for 36 times earnings, which may seem expensive since the S&P 500 averages a multiple of 18, the premium may be justifiable given the company's continuously improving financials. As its sales increase, so, too, will its profits, potentially bringing down that multiple in the future.

Costco is a good retail stock to invest in, even despite its seemingly high valuation.