Model

QuantityResolver

Magento\CatalogInventoryGraphQl\Model\Resolver\QuantityResolver

What it does

This resolver provides product quantity/stock information for GraphQL queries in Magento 2.

It determines how to display available product quantities based on the 'not_available_message' configuration setting, returning either the actual stock quantity or null.

Developers use this when building custom GraphQL queries that need to expose product inventory levels to storefronts or headless applications.

Public Methods

  • resolve()