Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Adding mutation and query to configurable and downloadable product endpoints #3867

Merged
merged 5 commits into from
Mar 5, 2019

Conversation

erikmarr
Copy link
Contributor

@erikmarr erikmarr commented Mar 4, 2019

This PR is a:

  • New topic
  • Content update
  • Content fix or rewrite
  • Bug fix or improvement

Summary

When this pull request is merged, it will fix #3779 and #3777.

Additional information

List all affected URLs

whatsnew
Added query and mutation to the configurable and downloadable product endpoints

@erikmarr erikmarr added Major Update Significant original updates to existing content Community Docs impacted by community code contribution xx2.3.1 Magento 2.3.1 changes labels Mar 4, 2019
@erikmarr erikmarr self-assigned this Mar 4, 2019
@erikmarr erikmarr requested a review from keharper March 4, 2019 21:47
@@ -3,18 +3,27 @@ group: graphql
title: ConfigurableProduct endpoint
---

The `ConfigurableProduct` endpoint defines which configurable product-specific attributes are returned when performing a `products` search.
The `ConfigurableProduct` endpoint defines a query and mutation for configurable products.
Copy link
Contributor

@keharper keharper Mar 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `ConfigurableProduct` endpoint defines a query and mutation for configurable products.
The `ConfigurableProduct` endpoint defines a mutation for adding configurable products to a cart. It also extends the `ProductInterface` so that attributes that are specific to configurable products can be queried in a `products` search.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a similar construction to the downloadable products topic

Field | Type | Description
### Syntax

`products(filter: {sku: {eq: "$ConfigurableProductSkuName"}})`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't correct. For now, delete the current syntax and add the following. This will take multiple passes:

Add the following inline fragment to the output section of your products query to return information specific to configurable products:

... on ConfigurableProduct {
  configurable_options {
   <attributes>
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

--- | --- | ---
`configurable_product_links` | SimpleProduct | An array of linked simple products
`configurable_product_options` | ConfigurableProductOptions | An array of linked simple product items
`configurable_product_options` | [ConfigurableProductOptions](#configProdOptions) | An array of linked simple product items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add another pair of brackets around ConfigurableProductOptions. One pair for the link, the other to show it's an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -23,17 +32,20 @@ Field | Type | Description
`label` | String | A string that describes the configurable product option. It is displayed on the UI.
`position` | Int | A number that indicates the order in which the attribute is displayed
`product_id` | Int | This is the same as a product's 'id' field
`values` | ConfigurableProductOptionsValues | An array that defines the value_index codes assigned to the configurable product
`values` | [ConfigurableProductOptionsValues](#configProdOptionsValues) | An array that defines the value_index codes assigned to the configurable product
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about brackets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


Attribute | Type | Description
--- | --- | ---
`cartItems` | [ConfigurableProductCartItemInput](#configProdCartItemInput) | An array of configurable items to add to the cart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brackets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


Field | Type | Description
Attributes | Type | Description
--- | --- | ---
`downloadable_product_links` | `DownloadableProductLinks` | An array containing information about the links for this downloadable product
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add brackets here and below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


Attributes | Type | Description
--- | --- | ---
`items` | [CustomerDownloadableProduct](#custDownloadProduct) | List of purchased downloadable items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brackets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor

@keharper keharper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, pending some tweaks.


Field | Type | Description
### Syntax
Add the following inline fragment to the output section of your products query to return information specific to configurable products:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add the following inline fragment to the output section of your products query to return information specific to configurable products:
Add the following inline fragment to the output section of your `products` query to return information specific to configurable products:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -23,17 +39,20 @@ Field | Type | Description
`label` | String | A string that describes the configurable product option. It is displayed on the UI.
`position` | Int | A number that indicates the order in which the attribute is displayed
`product_id` | Int | This is the same as a product's 'id' field
`values` | ConfigurableProductOptionsValues | An array that defines the value_index codes assigned to the configurable product
`values` | [[ConfigurableProductOptionsValues]](#configProdOptionsValues) | An array that defines the value_index codes assigned to the configurable product
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`values` | [[ConfigurableProductOptionsValues]](#configProdOptionsValues) | An array that defines the value_index codes assigned to the configurable product
`values` | [[ConfigurableProductOptionsValues]](#configProdOptionsValues) | An array that defines the `value_index` codes assigned to the configurable product

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -76,8 +95,8 @@ The following query returns information about configurable product `WH01`, which
product {
id
categories {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The categories object produces redundant output. Let's save a few electrons by removing that object from the query.

I can't comment on text that isn't near changed text, but also delete store_label, default_label, and use_default_value (lines 88-90).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


## DownloadableProduct object
### Syntax
Add the following inline fragment to the output section of your products query to return information specific to downloadable products:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add the following inline fragment to the output section of your products query to return information specific to downloadable products:
Add the following inline fragment to the output section of your `products` query to return information specific to downloadable products:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

## Downloadable product
The `DownloadableProduct` object contains the following attributes:

Attributes | Type | Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Attributes | Type | Description
Attribute | Type | Description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


Field | Type | Description
Attributes | Type | Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Attributes | Type | Description
Attribute | Type | Description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


Field | Type | Description
Attributes | Type | Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Attributes | Type | Description
Attribute | Type | Description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}
```

## Customer Downloadable Product {#customerDownloadProduct}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this query is defined in this module, move it so that it precedes the products query. Since ConfigurableProduct module only defined a mutation, it should be after the query.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved and created new section:

Downloadable product query

The DownloadableProduct query returns downloadable product information when you perform a products search.

### Customer downloadable products object
The `CustomerDownloadableProducts` object contains the following attribute.

Attributes | Type | Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Attributes | Type | Description
Attribute | Type | Description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

### Customer downloadable product object {#custDownloadProduct}
The `CustomerDownloadableProduct` object contains the following attributes:

Attributes | Type | Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Attributes | Type | Description
Attribute | Type | Description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@erikmarr erikmarr merged commit 72995b8 into 2.3.1-integration Mar 5, 2019
@ghost
Copy link

ghost commented Mar 5, 2019

Hi @erikmarr, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@erikmarr erikmarr deleted the em_magento-graphqlConfigDown branch March 5, 2019 22:53
@dshevtsov
Copy link
Collaborator

@erikmarr
There is missing whatsnew for the Major Update PR.

@dshevtsov
Copy link
Collaborator

dshevtsov commented Mar 25, 2019

@erikmarr please review the whatsnew description and remove an extra space inside parentheses in markdown hyperlinks

@keharper
Copy link
Contributor

@dshevtsov I deleted the space

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Docs impacted by community code contribution Major Update Significant original updates to existing content xx2.3.1 Magento 2.3.1 changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants