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

Commit 098db6d

Browse files
authored
Merge pull request #2428 from magento-commerce/kh_misc-graphql
GraphQL: Clean up for 2.4.3
2 parents 7c449f3 + 4e6e935 commit 098db6d

File tree

6 files changed

+134
-33
lines changed

6 files changed

+134
-33
lines changed

src/guides/v2.4/graphql/caching.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Magento caches the following queries:
2020
* `cmsBlocks`
2121
* `cmsPage`
2222
* `products`
23-
* `urlResolver`
23+
* `route`
24+
* `urlResolver` (deprecated)
2425

2526
Magento explicitly disallows caching the following queries.
2627

src/guides/v2.4/graphql/index.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,6 @@ landing-page: GraphQL Developer's Guide
66

77
[GraphQL](http://graphql.org/) is a data query language developed internally by Facebook in 2012 before being publicly released in 2015. Magento implements GraphQL to provide an alternative to REST and SOAP web APIs for frontend development.
88

9-
## The current state of Magento GraphQL
10-
11-
As of Magento 2.4.0, GraphQL provides the following features:
12-
13-
* Support for all product types, payment methods, and shipping methods
14-
* Redesigned a feature rich layered navigation
15-
* Reorders
16-
* Inventory Management store pickups
17-
18-
## Where we're going
19-
20-
The `graphql-ce` Community Engineering repository has been archived.
21-
22-
For the 2.4.1 and 2.4.2 releases, Magento and Community teams are working toward completing GraphQL coverage for Business to Consumer (B2C) use cases, with emphasis on the following:
23-
24-
* Order history for logged in customers
25-
* Replace product-specific mutations that add products to a cart with a single mutation that can handle all product types
26-
* Gift wrapping and messages
27-
* Product reviews
28-
* Wishlists
29-
* Reward points
30-
* Saved payment methods
31-
32-
We also expect to begin adding coverage for B2B scenarios.
33-
349
## How to access GraphQL
3510

3611
Use a GraphQL IDE such as [GraphiQL](https://github.com/graphql/graphiql) or a browser extension to run the code samples and tutorials. If you install a browser extension, make sure it has the ability to set request headers. On Google Chrome, [Altair GraphQL Client](https://chrome.google.com/webstore/detail/altair-graphql-client/flnheeellpciglgpaodhkhmapeljopja) is one extension that can do the job.

src/guides/v2.4/graphql/interfaces/bundle-product.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ Attribute | Type | Description
3939
`required` | Boolean | Indicates whether the item must be included in the bundle
4040
`sku` | String | The SKU of the bundle product
4141
`title` | String | The display name of the item
42-
`type` | String | The input type that the customer uses to select the item. Examples include radio button and checkbox.
42+
`type` | String | The input type that the customer uses to select the item. Examples include radio button and checkbox
4343
`uid` | ID | The unique ID for a `BundleItem` object
44+
4445
## BundleItemOption object
4546

4647
The `BundleItemOption` object contains the following attributes:

src/guides/v2.4/graphql/mutations/add-products-to-cart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ mutation {
171171

172172
#### Specify the SKU with selected options
173173

174-
In this example, the mutation specifies the size and color as selected options. The first option specifies the color, while the second option specifies the size.
174+
In this example, the mutation specifies the size and color as selected options. The first option specifies the color, while the second option specifies the size. The [`products` query]({{page.baseurl}}/graphql/queries/products.html#variant-uid) shows how to obtain the values specified in the `selected_options` array.
175175

176176
**Request:**
177177

src/guides/v2.4/graphql/queries/products.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,3 +1489,130 @@ The following product query returns URL rewrite information about the Joust Duff
14891489
}
14901490
}
14911491
```
1492+
1493+
### Retrieve variant `uid` values {#variant-uid}
1494+
1495+
The following query returns information about each variant of the configurable product `WSH12`. Each variant has a unique combination of color and size values. Specify the `uid` values in the `selected_options` array of the [`addProductsToCart` mutation]({{page.baseurl}}/graphql/mutations/add-products-to-cart.html) to indicate which variants the shopper selected.
1496+
1497+
**Request:**
1498+
1499+
```graphql
1500+
{
1501+
products(filter: {sku: {eq: "WSH12"}}) {
1502+
items {
1503+
sku
1504+
... on ConfigurableProduct {
1505+
variants {
1506+
attributes {
1507+
uid
1508+
label
1509+
code
1510+
}
1511+
}
1512+
}
1513+
}
1514+
}
1515+
}
1516+
```
1517+
1518+
**Response:**
1519+
1520+
```json
1521+
{
1522+
"data": {
1523+
"products": {
1524+
"items": [
1525+
{
1526+
"sku": "WSH12",
1527+
"variants": [
1528+
{
1529+
"attributes": [
1530+
{
1531+
"uid": "Y29uZmlndXJhYmxlLzkzLzUz",
1532+
"label": "Green",
1533+
"code": "color"
1534+
},
1535+
{
1536+
"uid": "Y29uZmlndXJhYmxlLzE2MC8xNzE=",
1537+
"label": "28",
1538+
"code": "size"
1539+
}
1540+
]
1541+
},
1542+
{
1543+
"attributes": [
1544+
{
1545+
"uid": "Y29uZmlndXJhYmxlLzkzLzU3",
1546+
"label": "Purple",
1547+
"code": "color"
1548+
},
1549+
{
1550+
"uid": "Y29uZmlndXJhYmxlLzE2MC8xNzE=",
1551+
"label": "28",
1552+
"code": "size"
1553+
}
1554+
]
1555+
},
1556+
{
1557+
"attributes": [
1558+
{
1559+
"uid": "Y29uZmlndXJhYmxlLzkzLzU4",
1560+
"label": "Red",
1561+
"code": "color"
1562+
},
1563+
{
1564+
"uid": "Y29uZmlndXJhYmxlLzE2MC8xNzE=",
1565+
"label": "28",
1566+
"code": "size"
1567+
}
1568+
]
1569+
},
1570+
{
1571+
"attributes": [
1572+
{
1573+
"uid": "Y29uZmlndXJhYmxlLzkzLzUz",
1574+
"label": "Green",
1575+
"code": "color"
1576+
},
1577+
{
1578+
"uid": "Y29uZmlndXJhYmxlLzE2MC8xNzI=",
1579+
"label": "29",
1580+
"code": "size"
1581+
}
1582+
]
1583+
},
1584+
{
1585+
"attributes": [
1586+
{
1587+
"uid": "Y29uZmlndXJhYmxlLzkzLzU3",
1588+
"label": "Purple",
1589+
"code": "color"
1590+
},
1591+
{
1592+
"uid": "Y29uZmlndXJhYmxlLzE2MC8xNzI=",
1593+
"label": "29",
1594+
"code": "size"
1595+
}
1596+
]
1597+
},
1598+
{
1599+
"attributes": [
1600+
{
1601+
"uid": "Y29uZmlndXJhYmxlLzkzLzU4",
1602+
"label": "Red",
1603+
"code": "color"
1604+
},
1605+
{
1606+
"uid": "Y29uZmlndXJhYmxlLzE2MC8xNzI=",
1607+
"label": "29",
1608+
"code": "size"
1609+
}
1610+
]
1611+
}
1612+
]
1613+
}
1614+
]
1615+
}
1616+
}
1617+
}
1618+
```

src/guides/v2.4/graphql/release-notes.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ group: graphql
33
title: Release Notes
44
---
55

6-
*Release notes published October 2020.*
6+
{:.bs-callout-info}
7+
As of version 2.4.1, the GraphQL release notes are included in the [{{site.data.var.ee}} and {{site.data.var.ce}} Release Notes]({{page.baseurl}}/release-notes/bk-release-notes.html).
78

89
GraphQL is a flexible and performant API that allows you to build custom front-ends, including headless storefronts, [Progressive Web Apps](https://github.com/magento/pwa-studio) (PWA), and mobile apps for Magento.
910

@@ -14,10 +15,6 @@ These release notes can include:
1415
- {:.new}New features
1516
- {:.fix}Fixes and improvements
1617

17-
## {{site.data.var.ee}} and {{site.data.var.ce}} 2.4.1
18-
19-
As of version 2.4.1, the [Magento Open Source 2.4.1 Release Notes]({{page.baseurl}}/release-notes/open-source-2-4-1.html) and [Magento Commerce 2.4.1 Release Notes]({{page.baseurl}}/release-notes/commerce-2-4-1.html) describe the new GraphQL features and bug fixes.
20-
2118
## {{site.data.var.ee}} and {{site.data.var.ce}} 2.4.0
2219

2320
- {:.new} **Added the [`reorderItems` mutation]({{page.baseurl}}/graphql/mutations/reorder-items.html).** This mutation enables the logged-in customer to add the contents of a previous order to their cart.

0 commit comments

Comments
 (0)