Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Return URL Rewrites for products #84

Closed
paliarush opened this issue Jun 5, 2018 · 1 comment
Closed

Return URL Rewrites for products #84

paliarush opened this issue Jun 5, 2018 · 1 comment
Assignees
Labels
good first issue Good for newcomers medium

Comments

@paliarush
Copy link
Contributor

paliarush commented Jun 5, 2018

As a Magento developer, I want GraphQL to return enough data so I can construct category-inclusive product urls so I can render context-aware product links on category pages and support the built-in "use categories path for product URLs" feature.

products query already supports canonical URL for products, this URL is returned as if it was generated by search with no category added to the URL. For example https://magento.store/some-product.html.

Sometimes it makes sense to have category added as part of SEO friendly URL, for example https://magento.store/some-category/some-product.html. It can be useful while rendering links to products from the specific category page.

AC:

  • Add url_rewrites: ![UrlRewrite] field to ProductInterface GraphQL type
  • UrlRewrite GraphQL type should have the following fields:
    • url: String
    • parameters: [HttpQueryParameter]. HttpQueryParameter type should have fields:
      • name: String
      • value: String
  • It should be possible to reuse the same types and resolvers for other entities in the future, e.g. for categories or CMS pages
  • Redirect rewrites must be excluded from the response (see rewrites grid in the admin panel for more info)
  • Modularity should be taken into account and new dependencies between modules should not be introduced. ProductInterface schema should be modified via changes in Magento/CatalogUrlRewriteGraphQl module
  • Changes are covered with web API functional tests. See \Magento\GraphQl\Catalog\ProductViewTest::testQueryAllFieldsSimpleProduct as an example.
@naydav
Copy link
Contributor

naydav commented Oct 4, 2018

#107

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers medium
Projects
None yet
Development

No branches or pull requests

3 participants