From b91f5c81dc994d070aca3e7bb453f08cdc8eb756 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Mon, 17 Sep 2018 20:29:49 +0300 Subject: [PATCH] GraphQL-133: Complexity limiter prototype --- .../Framework/GraphQl/Query/QueryComplexityLimiter.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/internal/Magento/Framework/GraphQl/Query/QueryComplexityLimiter.php b/lib/internal/Magento/Framework/GraphQl/Query/QueryComplexityLimiter.php index 15e0edb2400..b302f427252 100644 --- a/lib/internal/Magento/Framework/GraphQl/Query/QueryComplexityLimiter.php +++ b/lib/internal/Magento/Framework/GraphQl/Query/QueryComplexityLimiter.php @@ -13,6 +13,8 @@ use GraphQL\Validator\Rules\QueryComplexity; /** + * QueryComplexityLimiter + * * Sets limits for query complexity. A single GraphQL query can potentially * generate thousands of database operations so, the very complex queries * should be filtered and rejected. @@ -43,6 +45,11 @@ public function __construct( $this->queryComplexity = $queryComplexity; } + /** + * Sets limits for query complexity + * + * @return void + */ public function execute(): void { DocumentValidator::addRule(new QueryComplexity($this->queryComplexity));