/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/GraphQl/Query/MaximumAliasConfiguration.php
60 строк
2 KB
hemanthjadobe
AC-14323: Graphql query batching process enhanced
22 май 2025, 15:54
22 май 2025, 15:54
f83cc26
Код
Авторство
О чём код?
<?php /** * Copyright 2025 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\GraphQl\Query; use Magento\Framework\App\Config\ScopeConfigInterface; /** * Class for fetching the maximum allowed alias count in graphql request */ class MaximumAliasConfiguration { /** * Constant for maximum alias allowed value config path */ private const CONFIG_PATH_MAXIMUM_ALIAS_ALLOWED = 'graphql/validation/maximum_alias_allowed'; /** * Constant for maximum alias enable config path */ private const CONFIG_PATH_MAXIMUM_ALIAS_ENABLED = 'graphql/validation/alias_limit_enabled'; /** * @var ScopeConfigInterface */ private $scopeConfigInterface; /** * @param scopeConfigInterfacee $scopeConfigInterface */ public function __construct( ScopeConfigInterface $scopeConfigInterface ) { $this->scopeConfigInterface = $scopeConfigInterface; } /** * Check the environment config to get the maximum allowed alias in graphql request. * * @return int */ public function getMaximumAliasAllowed(): int { return (int) $this->scopeConfigInterface->getValue(self::CONFIG_PATH_MAXIMUM_ALIAS_ALLOWED); } /** * Check the environment config to check if maximum alias limit is enabled. * * @return bool */ public function isMaximumAliasLimitEnabled(): bool { return (bool) $this->scopeConfigInterface->getValue(self::CONFIG_PATH_MAXIMUM_ALIAS_ENABLED); } }