Skip to content

Commit e6fb2d7

Browse files
Marked canonical_url field as deprecated
1 parent b35406f commit e6fb2d7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function resolve(
7575
if ($urlRewrite) {
7676
$result = [
7777
'id' => $urlRewrite->getEntityId(),
78+
'canonical_url' => $urlRewrite->getTargetPath(),
7879
'relative_url' => $urlRewrite->getTargetPath(),
7980
'type' => $this->sanitizeType($urlRewrite->getEntityType())
8081
];

app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type Query {
77

88
type EntityUrl @doc(description: "EntityUrl is an output object containing the `id`, `relative_url`, and `type` attributes") {
99
id: Int @doc(description: "The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID.")
10+
canonical_url: String @deprecated(reason: "The canonical_url field is deprecated, use relative_url instead.")
1011
relative_url: String @doc(description: "The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original.")
1112
type: UrlRewriteEntityTypeEnum @doc(description: "One of PRODUCT, CATEGORY, or CMS_PAGE.")
1213
}

0 commit comments

Comments
 (0)