Log in
Model

Variant

Magento\ConfigurableProductGraphQl\Model\Formatter\Variant

What it does

This class formats and identifies the correct product variant for a configurable product based on customer-selected options in GraphQL queries.

Developers use this when implementing GraphQL resolvers that need to determine which simple product matches a specific combination of configurable options (like size and color).

It validates the selected options and returns the matching variant product with its data and URL.

Public Methods

  • format()