-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adding mutation and query to configurable and downloadable product endpoints #3867
Conversation
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated sentence
There was a problem hiding this comment.
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"}})` |
There was a problem hiding this comment.
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>
}
}
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about brackets
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brackets
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brackets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attributes | Type | Description | |
Attribute | Type | Description |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attributes | Type | Description | |
Attribute | Type | Description |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attributes | Type | Description | |
Attribute | Type | Description |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attributes | Type | Description | |
Attribute | Type | Description |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attributes | Type | Description | |
Attribute | Type | Description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Hi @erikmarr, thank you for your contribution! |
@erikmarr |
@erikmarr please review the |
@dshevtsov I deleted the space |
This PR is a:
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