Model

OnlyXLeftInStockResolver

Magento\CatalogInventoryGraphQl\Model\Resolver\OnlyXLeftInStockResolver

What it does

This resolver provides the 'only X left in stock' quantity for products in GraphQL queries.

It checks the store configuration threshold and returns the remaining stock quantity when inventory falls below that threshold, helping developers display low stock warnings to customers in their GraphQL-based storefronts.

Public Methods

  • resolve()