Skip to content

Commit 46cb0c6

Browse files
ENGCOM-5718: Customer downloadable products GraphQL #802
- Merge Pull Request magento/graphql-ce#802 from magento/graphql-ce:685-CustomerDownloadableGraphQl - Merged commits: 1. d4f0f25 2. 3a403ea 3. d42c43b 4. 59e452f 5. f55229e 6. a4da0fd 7. 796ce7f 8. bfe26d8 9. a16952c 10. 9a17c46 11. 50d68d4 12. cc2872d 13. 486d383 14. 7a59397 15. bda5529 16. fbcc247 17. 13bb280 18. 1d16054 19. bd5ac97
2 parents adee85d + bd5ac97 commit 46cb0c6

File tree

12 files changed

+92
-45
lines changed

12 files changed

+92
-45
lines changed

app/code/Magento/DownloadableGraphQl/Resolver/Customer/DownloadableProducts.php renamed to app/code/Magento/CustomerDownloadableGraphQl/Model/Resolver/CustomerDownloadableProducts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\DownloadableGraphQl\Resolver\Customer;
8+
namespace Magento\CustomerDownloadableGraphQl\Model\Resolver;
99

1010
use Magento\DownloadableGraphQl\Model\ResourceModel\GetPurchasedDownloadableProducts;
1111
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
@@ -20,7 +20,7 @@
2020
*
2121
* Returns available downloadable products for customer
2222
*/
23-
class DownloadableProducts implements ResolverInterface
23+
class CustomerDownloadableProducts implements ResolverInterface
2424
{
2525
/**
2626
* @var GetPurchasedDownloadableProducts
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# DownloadableGraphQl
2+
3+
**CustomerDownloadableGraphQl** provides type and resolver information for the GraphQl module
4+
to generate downloadable product information.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Downloadable Graph Ql Functional Tests
2+
3+
The Functional Test Module for **Magento Customer Downloadable Graph Ql** module.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "magento/module-customer-downloadable-graph-ql",
3+
"description": "N/A",
4+
"type": "magento2-module",
5+
"require": {
6+
"php": "~7.1.3||~7.2.0||~7.3.0",
7+
"magento/module-downloadable-graph-ql": "*",
8+
"magento/module-graph-ql": "*",
9+
"magento/framework": "*"
10+
},
11+
"suggest": {
12+
"magento/module-catalog-graph-ql": "*"
13+
},
14+
"license": [
15+
"OSL-3.0",
16+
"AFL-3.0"
17+
],
18+
"autoload": {
19+
"files": [
20+
"registration.php"
21+
],
22+
"psr-4": {
23+
"Magento\\CustomerDownloadableGraphQl\\": ""
24+
}
25+
}
26+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9+
<module name="Magento_CustomerDownloadableGraphQl" >
10+
<sequence>
11+
<module name="Magento_GraphQl"/>
12+
<module name="Magento_DownloadableGraphQl"/>
13+
</sequence>
14+
</module>
15+
</config>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright © Magento, Inc. All rights reserved.
2+
# See COPYING.txt for license details.
3+
4+
type Query {
5+
customerDownloadableProducts: CustomerDownloadableProducts @resolver(class: "Magento\\CustomerDownloadableGraphQl\\Model\\Resolver\\CustomerDownloadableProducts") @doc(description: "The query returns the contents of a customer's downloadable products") @cache(cacheable: false)
6+
}
7+
8+
type CustomerDownloadableProducts {
9+
items: [CustomerDownloadableProduct] @doc(description: "List of purchased downloadable items")
10+
}
11+
12+
type CustomerDownloadableProduct {
13+
order_increment_id: String
14+
date: String
15+
status: String
16+
download_url: String
17+
remaining_downloads: String
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
use Magento\Framework\Component\ComponentRegistrar;
8+
9+
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_CustomerDownloadableGraphQl', __DIR__);

app/code/Magento/DownloadableGraphQl/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"php": "~7.1.3||~7.2.0||~7.3.0",
77
"magento/module-catalog": "*",
88
"magento/module-downloadable": "*",
9-
"magento/module-graph-ql": "*",
109
"magento/module-quote": "*",
1110
"magento/module-quote-graph-ql": "*",
1211
"magento/framework": "*"

app/code/Magento/DownloadableGraphQl/etc/schema.graphqls

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
33

4-
type Query {
5-
customerDownloadableProducts: CustomerDownloadableProducts @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Customer\\DownloadableProducts") @doc(description: "The query returns the contents of a customer's downloadable products") @cache(cacheable: false)
6-
}
7-
84
type Mutation {
95
addDownloadableProductsToCart(input: AddDownloadableProductsToCartInput): AddDownloadableProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
106
}
@@ -34,18 +30,6 @@ type DownloadableCartItem implements CartItemInterface @doc(description: "Downlo
3430
samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Samples") @doc(description: "DownloadableProductSamples defines characteristics of a downloadable product")
3531
}
3632

37-
type CustomerDownloadableProducts {
38-
items: [CustomerDownloadableProduct] @doc(description: "List of purchased downloadable items")
39-
}
40-
41-
type CustomerDownloadableProduct {
42-
order_increment_id: String
43-
date: String
44-
status: String
45-
download_url: String
46-
remaining_downloads: String
47-
}
48-
4933
type DownloadableProduct implements ProductInterface, CustomizableProductInterface @doc(description: "DownloadableProduct defines a product that the customer downloads") {
5034
downloadable_product_samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Samples") @doc(description: "An array containing information about samples of this downloadable product.")
5135
downloadable_product_links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Links") @doc(description: "An array containing information about the links for this downloadable product")

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
"magento/module-currency-symbol": "*",
148148
"magento/module-customer": "*",
149149
"magento/module-customer-analytics": "*",
150+
"magento/module-customer-downloadable-graph-ql": "*",
150151
"magento/module-customer-import-export": "*",
151152
"magento/module-deploy": "*",
152153
"magento/module-developer": "*",

0 commit comments

Comments
 (0)