Log in
Model

DepthCalculator

Magento\CatalogGraphQl\Model\Category\DepthCalculator

What it does

This class calculates the depth of category tree queries in GraphQL requests.

Developers use it to determine how many levels deep a category tree query goes, which is essential for performance optimization and preventing excessively deep queries that could impact database performance.

It recursively analyzes the GraphQL query structure including fragments and inline fragments to compute the total depth.

Public Methods

  • calculate()