Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CanonicalUrl.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
15 
20 {
24  public function resolve(
25  Field $field,
26  $context,
28  array $value = null,
29  array $args = null
30  ) {
31  if (!isset($value['model'])) {
32  throw new GraphQlInputException(__('"model" value should be specified'));
33  }
34 
35  /* @var $product Product */
36  $product = $value['model'];
37  $url = $product->getUrlModel()->getUrl($product, ['_ignore_category' => true]);
38 
39  return $url;
40  }
41 }
resolve(Field $field, $context, ResolveInfo $info, array $value=null, array $args=null)
__()
Definition: __.php:13
$value
Definition: gender.phtml:16
foreach( $_productCollection as $_product)() ?>" class $info
Definition: listing.phtml:52