init
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Magento\TestModuleGraphQlQueryExtension\Model\Resolver;
|
||||
|
||||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
|
||||
use Magento\Framework\GraphQl\Config\Element\Field;
|
||||
use Magento\Framework\GraphQl\Query\ResolverInterface;
|
||||
|
||||
/**
|
||||
* Class IntegerList
|
||||
*/
|
||||
class IntegerList implements ResolverInterface
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function resolve(
|
||||
Field $field,
|
||||
$context,
|
||||
ResolveInfo $info,
|
||||
array $value = null,
|
||||
array $args = null
|
||||
) {
|
||||
if (!isset($value['item_id'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$itemId = $value['item_id'];
|
||||
|
||||
$resultData = [$itemId + 1, $itemId + 2, $itemId + 3];
|
||||
return $resultData;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user