Log in
Collection

Variant\Collection

Magento\ConfigurableProductGraphQl\Model\Variant\Collection

What it does

This class manages the fetching and caching of child products (variants) for configurable products in GraphQL queries.

Developers use it to efficiently load variant product data by parent product ID, allowing batch loading of child products with their attributes while avoiding N+1 query problems in GraphQL resolvers.

Public Methods

  • addParentProduct()
  • addEavAttributes()
  • getChildProductsByParentId()
  • _resetState()