From 0e180565b8537ed49e9897867c1e0f7abcdd71f1 Mon Sep 17 00:00:00 2001 From: Denis Protassoff Date: Tue, 13 Dec 2022 11:02:34 +0300 Subject: [PATCH] Added display mode for categories --- src/Model/Resolver/EntityUrl.php | 2 ++ src/etc/schema.graphqls | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Model/Resolver/EntityUrl.php b/src/Model/Resolver/EntityUrl.php index 34b5bb8..2aa6be5 100644 --- a/src/Model/Resolver/EntityUrl.php +++ b/src/Model/Resolver/EntityUrl.php @@ -138,6 +138,8 @@ public function resolve( $storeId = $this->storeManager->getStore()->getId(); $category = $this->categoryRepository->get($id, $storeId); + $result['display_mode'] = $category->getDisplayMode(); + if (!$category->getIsActive()) { return null; } diff --git a/src/etc/schema.graphqls b/src/etc/schema.graphqls index cbf67a2..2ae0249 100644 --- a/src/etc/schema.graphqls +++ b/src/etc/schema.graphqls @@ -12,6 +12,7 @@ type EntityUrl @doc(description: "EntityUrl is an output object containing the ` sku: String @doc(description: "If URL rewrite is of type PRODUCT - it will return SKU here") canonical_url: String @doc(description: "The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original.") type: UrlRewriteEntityTypeEnum @doc(description: "One of PRODUCT, CATEGORY, or CMS_PAGE.") + display_mode: String @doc(description: "One of PRODUCTS, PAGE or PRODUCTS_AND_PAGE") } type Query {