I create custom graphql and have a error,please help me.
type Query {
testSharingData (
id: Int @doc(description: "The ID of the CMS page.")
): TestSharingData @resolver(class: "GlobalBq\\SharingGraphQl\\Model\\Resolver\\SharingItem") @doc(description: "Return details about a CMS page.")
}
type TestSharingData @doc(description: "SharingData defines the customer name and other details"){
customer_id: Int
}
<?php
declare(strict_types=1);
namespace GlobalBq\SharingGraphQl\Model\Resolver;
use GlobalBq\SharingGraphQl\Model\ResourceModel\Sharing\Collection;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
class SharingItem implements \Magento\Framework\GraphQl\Query\ResolverInterface
{
/**
* @var Collection
*/
private Collection $collection;
/**
* @param Collection $collection
*/
public function __construct(Collection $collection)
{
$this->collection = $collection;
}
/**
* @inheritDoc
*/
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
{
$postData = [
"customer_id" => 31
];
return $postData;
}
}