Skip to content

Commit afd96ac

Browse files
authored
Merge pull request AdobeDocs#402 from svera/LYNX-679
LYNX-679: Added documentation for new queries
2 parents c8062c3 + 31449cf commit afd96ac

File tree

9 files changed

+348
-2
lines changed

9 files changed

+348
-2
lines changed

src/data/navigation/sections/graphql.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ module.exports = [
127127
title: "Queries",
128128
path: "/graphql/schema/cart/queries/",
129129
pages: [
130+
{
131+
title: "allCartRules",
132+
path: "/graphql/schema/cart/queries/all-rules/",
133+
},
130134
{
131135
title: "cart",
132136
path: "/graphql/schema/cart/queries/cart/",
@@ -443,6 +447,14 @@ module.exports = [
443447
title: "Queries",
444448
path: "/graphql/schema/customer/queries/",
445449
pages: [
450+
{
451+
title: "allCustomerGroups",
452+
path: "/graphql/schema/customer/queries/all-groups/"
453+
},
454+
{
455+
title: "allCustomerSegments",
456+
path: "/graphql/schema/customer/queries/all-segments/"
457+
},
446458
{
447459
title: "customer",
448460
path: "/graphql/schema/customer/queries/customer/",
@@ -459,6 +471,10 @@ module.exports = [
459471
title: "customerOrders",
460472
path: "/graphql/schema/customer/queries/orders/",
461473
},
474+
{
475+
title: "customerSegments",
476+
path: "/graphql/schema/customer/queries/segments/"
477+
},
462478
{
463479
title: "giftCardAccount",
464480
path: "/graphql/schema/customer/queries/giftcard-account/",
@@ -801,6 +817,10 @@ module.exports = [
801817
title: "Queries",
802818
path: "/graphql/schema/products/queries/",
803819
pages: [
820+
{
821+
title: "allCatalogRules",
822+
path: "/graphql/schema/products/queries/all-rules/",
823+
},
804824
{
805825
title: "categories",
806826
path: "/graphql/schema/products/queries/categories/",
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: allCartRules query
3+
edition: ee
4+
---
5+
6+
# allCartRules query
7+
8+
<InlineAlert variant="info" slots="text1" />
9+
10+
This query is part of the [Storefront Compatibility Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/storefront-compatibility/). It will be added to Adobe Commerce 2.4.8-beta4.
11+
12+
The `allCartRules` query returns a list of all active cart rules in the store.
13+
14+
Cart price rules apply discounts to items in the shopping cart, based on a set of conditions.
15+
16+
## Syntax
17+
18+
```graphql
19+
{
20+
allCartRules {
21+
name
22+
}
23+
}
24+
```
25+
26+
<!---
27+
## Reference
28+
29+
The [`allCartRules`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-all-cart-rules) reference provides detailed information about the types and fields defined in this query.
30+
-->
31+
32+
## Example usage
33+
34+
The following call returns a list of all active cart rules in the store.
35+
36+
**Request:**
37+
38+
```graphql
39+
{
40+
allCartRules {
41+
name
42+
}
43+
}
44+
```
45+
46+
**Response:**
47+
48+
```json
49+
{
50+
"allCartRules": [
51+
{
52+
"name": "Rule A"
53+
},
54+
{
55+
"name": "Rule B"
56+
}
57+
]
58+
}
59+
```

src/pages/graphql/schema/cart/queries/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Cart queries
44

55
# Cart queries
66

7-
The `cart` query returns the content of the shopper's cart. Adobe Commerce returns the [`Cart`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#definition-Cart) object. This object is also returned by numerous mutations, including those that add products to the cart and prepare a cart for checkout.
7+
The [`cart`](./cart.md) query returns the content of the shopper's cart. Adobe Commerce returns the [`Cart`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#definition-Cart) object. This object is also returned by numerous mutations, including those that add products to the cart and prepare a cart for checkout.
88

9-
When Inventory Management is installed and configured, you can use the `pickupLocations` query to help a shopper determine whether their order can be picked up at a physical location. This query is most useful when the shopper has selected one or more items for purchase.
9+
The [`allCartRules`](./all-rules.md) query returns a list of available cart rules.
10+
11+
When Inventory Management is installed and configured, you can use the [`pickupLocations`](./pickup-locations.md) query to help a shopper determine whether their order can be picked up at a physical location. This query is most useful when the shopper has selected one or more items for purchase.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: allCustomerGroups query
3+
edition: ee
4+
---
5+
6+
# allCustomerGroups query
7+
8+
<InlineAlert variant="info" slots="text1" />
9+
10+
This query is part of the [Storefront Compatibility Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/storefront-compatibility/). It will be added to Adobe Commerce 2.4.8-beta4.
11+
12+
The `allCustomerGroups` query returns a list of available customer groups.
13+
14+
Customer groups determine which discounts are available and the tax class that is associated with the group.
15+
16+
## Syntax
17+
18+
```graphql
19+
{
20+
allCustomerGroups {
21+
name
22+
}
23+
}
24+
```
25+
26+
<!---
27+
## Reference
28+
29+
The [`allCustomerGroups`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-all-customer-groups) reference provides detailed information about the types and fields defined in this query.
30+
-->
31+
32+
## Example usage
33+
34+
### Retrieve all customer groups
35+
36+
The following call returns a list of all customer groups.
37+
38+
**Request:**
39+
40+
```graphql
41+
{
42+
allCustomerGroups {
43+
name
44+
}
45+
}
46+
```
47+
48+
**Response:**
49+
50+
```json
51+
{
52+
"allCustomerGroups": [
53+
{
54+
"name": "Group A"
55+
},
56+
{
57+
"name": "Group B"
58+
}
59+
]
60+
}
61+
```
62+
63+
## Related topics
64+
65+
* [allCustomerSegments query](all-segments.md)
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: allCustomerSegments query
3+
edition: ee
4+
---
5+
6+
# allCustomerSegments query
7+
8+
<InlineAlert variant="info" slots="text1" />
9+
10+
This query is part of the [Storefront Compatibility Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/storefront-compatibility/). It will be added to Adobe Commerce 2.4.8-beta4.
11+
12+
The `allCustomerSegments` query returns information about the available customer segments.
13+
14+
Customer segments allow merchants to dynamically display content and promotions to specific customers, based on various properties.
15+
Examples include customer address, order history, and shopping cart contents.
16+
17+
## Syntax
18+
19+
```graphql
20+
{
21+
allCustomerSegments {
22+
name
23+
description
24+
apply_to
25+
}
26+
}
27+
```
28+
29+
<!--->
30+
## Reference
31+
32+
The [`allCustomerSegments`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-all-customer-segments) reference provides detailed information about the types and fields defined in this query.
33+
-->
34+
35+
## Example usage
36+
37+
The following call returns a list of all active customer segments.
38+
39+
**Request:**
40+
41+
```graphql
42+
{
43+
allCustomerSegments {
44+
name
45+
description
46+
apply_to
47+
}
48+
}
49+
```
50+
51+
**Response:**
52+
53+
```json
54+
{
55+
"allCustomerSegments": [
56+
{
57+
"name": "Guests",
58+
"description": "All shoppers who are not logged in",
59+
"apply_to": "VISITOR"
60+
},
61+
{
62+
"name": "Registered",
63+
"description": "Applies to all logged-in customers",
64+
"apply_to": "REGISTERED"
65+
}
66+
]
67+
}
68+
```
69+
70+
## Related topics
71+
72+
* [customerSegments query](segments.md)

src/pages/graphql/schema/customer/queries/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ title: Customer queries
66

77
Adobe Commerce provides the following customer-related queries:
88

9+
* [`allCustomerGroups`](all-groups.md)
10+
* [`allCustomerSegments`](all-segments.md)
911
* [`customer`](customer.md)
1012
* [`customerCart`](cart.md)
1113
* [`customerDownloadableProducts`](downloadable-products.md)
1214
* [`customerOrders`](orders.md)
15+
* [`customerSegments`](segments.md)
1316
* [`giftCardAccount`](giftcard-account.md)
1417
* [`isEmailAvailable`](is-email-available.md)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: customerSegments query
3+
edition: ee
4+
---
5+
6+
# customerSegments query
7+
8+
<InlineAlert variant="info" slots="text1" />
9+
10+
This query is part of the [Storefront Compatibility Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/storefront-compatibility/). It will be added to Adobe Commerce 2.4.8-beta4.
11+
12+
The `customerSegments` query returns information about the customer segments associated with the current customer or guest.
13+
14+
Customer segments allow merchants to dynamically display content and promotions to specific customers, based on various properties.
15+
Examples include customer address, order history, and shopping cart contents.
16+
17+
## Syntax
18+
19+
```graphql
20+
{
21+
customerSegments(
22+
cartId: String!
23+
): [CustomerSegment!]
24+
}
25+
```
26+
27+
<!--->
28+
## Reference
29+
30+
The [`customerSegments`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-customer-segments) reference provides detailed information about the types and fields defined in this query.
31+
-->
32+
33+
## Example usage
34+
35+
The following call returns segments currently applied to the visitor.
36+
37+
**Request:**
38+
39+
```graphql
40+
{
41+
customerSegments(cartId: "kw6mLEvl6vjjPNsjtJqwpamv5o0iT1bc") {
42+
name
43+
description
44+
apply_to
45+
}
46+
}
47+
```
48+
49+
**Response:**
50+
51+
```json
52+
{
53+
"customerSegments": [
54+
{
55+
"name": "Guests",
56+
"description": "All shoppers who are not logged in",
57+
"apply_to": "VISITOR"
58+
}
59+
]
60+
}
61+
```
62+
63+
## Related topics
64+
65+
* [allCustomerSegments query](all-segments.md)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: allCatalogRules query
3+
edition: ee
4+
---
5+
6+
# allCatalogRules query
7+
8+
<InlineAlert variant="info" slots="text1" />
9+
10+
This query is part of the [Storefront Compatibility Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/storefront-compatibility/). It will be added to Adobe Commerce 2.4.8-beta4.
11+
12+
The `allCatalogRules` query returns a list of all active catalog rules in the store.
13+
14+
Catalog price rules can be used to offer products to buyers at a discounted price, based on a set of defined conditions.
15+
16+
## Syntax
17+
18+
```graphql
19+
{
20+
allCatalogRules {
21+
name
22+
}
23+
}
24+
```
25+
26+
<!---
27+
## Reference
28+
29+
The [`allCatalogRules`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-all-catalog-rules) query returns a list of catalog rule names.
30+
-->
31+
32+
## Example usage
33+
34+
The following call returns a list of all active catalog rules in the store.
35+
36+
**Request:**
37+
38+
```graphql
39+
{
40+
allCatalogRules {
41+
name
42+
}
43+
}
44+
```
45+
46+
**Response:**
47+
48+
```json
49+
{
50+
"allCatalogRules": [
51+
{
52+
"name": "Rule A"
53+
},
54+
{
55+
"name": "Rule B"
56+
}
57+
]
58+
}
59+
```

0 commit comments

Comments
 (0)