Try Below Code
app/code/VendorName/ModuleName/etc
schema.graphqls
type CustomerDownloadableProduct @doc(description: "Contains details about a single downloadable product.") {
product_name: String @doc(description: "The Product Name")
link_title: String @doc(description: "The Product Link Name")
}
app/code/VendorName/ModuleName/etc/graphql
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\CustomerDownloadableGraphQl\Model\Resolver\CustomerDownloadableProducts"
type="VendorName\ModuleName\Model\Resolver\CustomerDownloadableProducts" />
</config>
app/code/VendorName/ModuleName/Model/Resolver
CustomerDownloadableProducts.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace VendorName\ModuleName\Model\Resolver;
use Magento\DownloadableGraphQl\Model\ResourceModel\GetPurchasedDownloadableProducts;
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\UrlInterface;
use Magento\GraphQl\Model\Query\ContextInterface;
use Magento\CustomerDownloadableGraphQl\Model\Resolver\CustomerDownloadableProducts as ParentClass;
/**
* @inheritdoc
*
* Returns available downloadable products for customer
*/
class CustomerDownloadableProducts extends ParentClass
{
/**
* @var GetPurchasedDownloadableProducts
*/
private $getPurchasedDownloadableProducts;
/**
* @var UrlInterface
*/
private $urlBuilder;
/**
* @param GetPurchasedDownloadableProducts $getPurchasedDownloadableProducts
* @param UrlInterface $urlBuilder
*/
public function __construct(
GetPurchasedDownloadableProducts $getPurchasedDownloadableProducts,
UrlInterface $urlBuilder
) {
$this->getPurchasedDownloadableProducts = $getPurchasedDownloadableProducts;
$this->urlBuilder = $urlBuilder;
parent::__construct(
$this->getPurchasedDownloadableProducts,
$this->urlBuilder = $urlBuilder
);
}
/**
* @inheritdoc
*/
public function resolve(
Field $field,
$context,
ResolveInfo $info,
array $value = null,
array $args = null
) {
/** @var ContextInterface $context */
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
}
$purchasedProducts = $this->getPurchasedDownloadableProducts->execute($context->getUserId());
$productsData = [];
/* The fields names are hardcoded since there's no existing name reference in the code */
foreach ($purchasedProducts as $purchasedProduct) {
if ($purchasedProduct['number_of_downloads_bought']) {
$remainingDownloads = $purchasedProduct['number_of_downloads_bought'] -
$purchasedProduct['number_of_downloads_used'];
} else {
$remainingDownloads = __('Unlimited');
}
$productsData[] = [
'product_name' => $purchasedProduct['product_name'],
'link_title' => $purchasedProduct['link_title'],
'order_increment_id' => $purchasedProduct['order_increment_id'],
'date' => $purchasedProduct['created_at'],
'status' => $purchasedProduct['status'],
'download_url' => $this->urlBuilder->getUrl(
'downloadable/download/link',
['id' => $purchasedProduct['link_hash'], '_secure' => true]
),
'remaining_downloads' => $remainingDownloads
];
}
return ['items' => $productsData];
}
}
Query:
{
customerDownloadableProducts {
items {
product_name
link_title
date
download_url
order_increment_id
remaining_downloads
status
}
}
}
OUTPUT:

Note: Before running the updated query above, please execute the Magento upgrade command.