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

Commit 76bffc1

Browse files
authored
Merge pull request #8530 from ajithkumar-maragathavel/graphql-custom-filters
Examples and links added
2 parents 04b55d8 + 6cc2d8a commit 76bffc1

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

src/guides/v2.3/graphql/custom-filters.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,72 @@ The [`filter`]({{page.baseurl}}/graphql/queries/products.html#ProductFilterInput
2525

2626
In this example, the custom attribute `volume` was assigned to the `bags` attribute group. Running the [`customAttributeMetadata` query]({{page.baseurl}}/graphql/queries/custom-attribute-metadata.html) on this custom attribute reveals that the `label` and `value` values for the attribute's options are as follows:
2727

28+
**Request:**
29+
30+
```graphql
31+
{
32+
customAttributeMetadata(
33+
attributes: [
34+
{
35+
attribute_code: "volume"
36+
entity_type: "catalog_product"
37+
}
38+
]
39+
) {
40+
items {
41+
attribute_code
42+
attribute_type
43+
entity_type
44+
input_type
45+
attribute_options {
46+
value
47+
label
48+
}
49+
}
50+
}
51+
}
52+
```
53+
54+
**Response:**
55+
56+
```graphql
57+
{
58+
"data": {
59+
"customAttributeMetadata": {
60+
"items": [
61+
{
62+
"attribute_code": "volume",
63+
"attribute_type": "Int",
64+
"entity_type": "catalog_product",
65+
"input_type": "select",
66+
"attribute_options": [
67+
{
68+
"value": "216",
69+
"label": "Large"
70+
},
71+
{
72+
"value": "217",
73+
"label": "Medium"
74+
},
75+
{
76+
"value": "218",
77+
"label": "Small"
78+
}
79+
]
80+
}
81+
]
82+
}
83+
}
84+
}
85+
```
86+
2887
`label` | `value`
2988
--- | ---
3089
`Large` | `216`
3190
`Medium` | `217`
3291
`Small` | `218`
3392

34-
In this scenario, a `products` search filtered to return items where the `volume` attribute is set to `Large` would be similar to the following:
93+
In this scenario, a [`products`]({{page.baseurl}}/graphql/queries/products.html) search filtered to return items where the `volume` attribute is set to `Large` would be similar to the following:
3594

3695
**Request:**
3796

0 commit comments

Comments
 (0)