U.S. stock market action on July 31 centered on a sharp drop in Apple shares and a strong gain in Amazon. Apple stock slid 7.4%, yet the Nasdaq still pushed higher as strength elsewhere in big technology names helped offset the decline.

The pullback in Apple erased about $358 billion from the company's market value, making it one of the market's biggest stories of the day. Even so, the iPhone maker's weakness was not enough to derail the broader move in the tech-heavy index.

Amazon's rally played a major role in keeping indexes on an upward path. The session highlighted how heavily weighted mega-cap companies can pull the market in different directions, with one major loser and one major winner shaping the overall performance.

The trading day underscored a familiar theme on Wall Street: index gains do not always reflect broad strength across every major stock. On July 31, Apple suffered a notable selloff, but Amazon's surge helped the Nasdaq march higher anyway.