-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'graphQl-44-product-textarea-field-format' of github.com…
…:magento/graphql-ce into graphQl-44-product-textarea-field-format
- Loading branch information
Showing
9 changed files
with
89 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
...de/Magento/CatalogGraphQl/Model/Resolver/Product/ProductTextAttribute/FormatInterface.php
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductTextAttribute/FormatList.php
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductTextAttribute/Html.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/code/Magento/GraphQl/Model/Resolver/ComplexTextValue/HtmlFormat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\GraphQl\Model\Resolver\ComplexTextValue; | ||
|
||
use Magento\Framework\GraphQl\Config\Element\Field; | ||
use Magento\Framework\GraphQl\Exception\GraphQlInputException; | ||
use Magento\Framework\GraphQl\Query\ResolverInterface; | ||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; | ||
|
||
/** | ||
* HTML format for complex text value. | ||
* | ||
* Initially, a value from parent resolver should be in HTML format, therefore, there is no any customization. | ||
*/ | ||
class HtmlFormat implements ResolverInterface | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolve( | ||
Field $field, | ||
$context, | ||
ResolveInfo $info, | ||
array $value = null, | ||
array $args = null | ||
): ?string { | ||
if (!isset($value['html'])) { | ||
throw new GraphQlInputException(__('"html" value should be specified')); | ||
} | ||
|
||
return $value['html']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters