Skip to content

Commit b34789d

Browse files
committed
LYNX-679: Added documentation for new queries
1 parent 96a5956 commit b34789d

File tree

5 files changed

+284
-0
lines changed

5 files changed

+284
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: all cart rules query
3+
---
4+
5+
# All cart rules query
6+
7+
The `allCartRules` query returns information about all active cart rules in the store.
8+
9+
## Syntax
10+
11+
```graphql
12+
{
13+
allCartRules {
14+
name
15+
}
16+
}
17+
```
18+
19+
## Reference
20+
21+
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.
22+
23+
## Example usage
24+
25+
### Retrieve all cart rules
26+
27+
The following call returns a list of all active cart rules in the store.
28+
29+
**Request:**
30+
31+
```graphql
32+
{
33+
allCartRules {
34+
name
35+
}
36+
}
37+
```
38+
39+
**Response:**
40+
41+
```json
42+
{
43+
"allCartRules": [
44+
{
45+
"name": "Rule A"
46+
},
47+
{
48+
"name": "Rule B"
49+
}
50+
]
51+
}
52+
```
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: all customer segments query
3+
---
4+
5+
# All customer segments query
6+
7+
The `allCustomerSegments` query returns information about all the customer segments available.
8+
9+
## Syntax
10+
11+
```graphql
12+
{
13+
allCustomerSegments {
14+
name
15+
description
16+
apply_to
17+
}
18+
}
19+
```
20+
21+
## Reference
22+
23+
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.
24+
25+
## Example usage
26+
27+
### Retrieve all active customer segments
28+
29+
The following call returns a list of all active customer segments.
30+
31+
**Request:**
32+
33+
```graphql
34+
{
35+
allCustomerSegments {
36+
name
37+
description
38+
apply_to
39+
}
40+
}
41+
```
42+
43+
**Response:**
44+
45+
```json
46+
{
47+
"allCustomerSegments": [
48+
{
49+
"name": "Segment A",
50+
"description": "Lorem ipsum",
51+
"apply_to": "VISITOR"
52+
},
53+
{
54+
"name": "Segment B",
55+
"description": "Lorem ipsum",
56+
"apply_to": "VISITOR"
57+
}
58+
]
59+
}
60+
```
61+
62+
## Related topics
63+
64+
* [customerSegments query](segments.md)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: all customer groups query
3+
---
4+
5+
# All customer groups query
6+
7+
The `allCustomerGroupss` query returns information about all customer groups available.
8+
9+
## Syntax
10+
11+
```graphql
12+
{
13+
allCustomerGroups {
14+
name
15+
}
16+
}
17+
```
18+
19+
## Reference
20+
21+
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.
22+
23+
## Example usage
24+
25+
### Retrieve all customer groups
26+
27+
The following call returns a list of all customer groups.
28+
29+
**Request:**
30+
31+
```graphql
32+
{
33+
allCustomerGroups {
34+
name
35+
}
36+
}
37+
```
38+
39+
**Response:**
40+
41+
```json
42+
{
43+
"allCustomerGroups": [
44+
{
45+
"name": "Group A"
46+
},
47+
{
48+
"name": "Group B"
49+
}
50+
]
51+
}
52+
```
53+
54+
## Related topics
55+
56+
* [allCustomerSegments query](all-segments.md)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: customer segments query
3+
---
4+
5+
# customer segments query
6+
7+
The `customerSegments` query returns information about the customer segments associated with the current customer or guest/visitor.
8+
9+
## Syntax
10+
11+
```graphql
12+
{
13+
customerSegments(
14+
cartId: String!
15+
): [CustomerSegment!]
16+
}
17+
```
18+
19+
## Reference
20+
21+
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.
22+
23+
## Example usage
24+
25+
### Retrieve segments information of a visitor
26+
27+
The following call returns segments currently applied to the visitor.
28+
29+
**Request:**
30+
31+
```graphql
32+
{
33+
customerSegments(cartId: "kw6mLEvl6vjjPNsjtJqwpamv5o0iT1bc") {
34+
name
35+
description
36+
apply_to
37+
}
38+
}
39+
```
40+
41+
**Response:**
42+
43+
```json
44+
{
45+
"customerSegments": [
46+
{
47+
"name": "John",
48+
"description": "Doe",
49+
"apply_to": "VISITOR"
50+
}
51+
]
52+
}
53+
```
54+
55+
## Related topics
56+
57+
* [isEmailAvailable query](../../b2b/company/queries/is-company-email-available.md)
58+
* [generateCustomerToken mutation](../mutations/generate-token.md)
59+
* [createCustomerV2 mutation](../mutations/create-v2.md)
60+
* [createCustomerAddress mutation](../mutations/create-address.md)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: all catalog rules query
3+
---
4+
5+
# All catalog rules query
6+
7+
The `allCatalogRules` query returns information about all active catalog rules in the store.
8+
9+
## Syntax
10+
11+
```graphql
12+
{
13+
allCatalogRules {
14+
name
15+
}
16+
}
17+
```
18+
19+
## Reference
20+
21+
The [`allCatalogRules`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-all-catalog-rules) reference provides detailed information about the types and fields defined in this query.
22+
23+
## Example usage
24+
25+
### Retrieve all catalog rules
26+
27+
The following call returns a list of all active catalog rules in the store.
28+
29+
**Request:**
30+
31+
```graphql
32+
{
33+
allCatalogRules {
34+
name
35+
}
36+
}
37+
```
38+
39+
**Response:**
40+
41+
```json
42+
{
43+
"allCatalogRules": [
44+
{
45+
"name": "Rule A"
46+
},
47+
{
48+
"name": "Rule B"
49+
}
50+
]
51+
}
52+
```

0 commit comments

Comments
 (0)