Log in
Model

CanonicalUrl

Magento\CatalogGraphQl\Model\Resolver\Category\CanonicalUrl

What it does

This resolver returns the canonical URL for a category in GraphQL queries.

Developers use this when building headless Magento 2 storefronts that need to retrieve SEO-friendly category URLs through GraphQL.

It respects the store configuration for canonical tags and strips the base URL to return a relative path.

Public Methods

  • resolve()