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

Commit de6388b

Browse files
committed
Add new example
1 parent 415d247 commit de6388b

File tree

1 file changed

+81
-56
lines changed

1 file changed

+81
-56
lines changed

guides/v2.3/graphql/reference/custom-attribute-metadata.md

Lines changed: 81 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -31,40 +31,23 @@ The following query returns the attribute type for various custom and EAV attrib
3131

3232
{% highlight json %}
3333
{
34-
customAttributeMetadata(attributes:
35-
[
36-
{
37-
attribute_code: "available_sort_by",
38-
entity_type: "catalog_category"
39-
},
40-
{
41-
attribute_code: "quantity_and_stock_status",
42-
entity_type: "catalog_product"
43-
},
44-
{
45-
attribute_code: "default_billing",
46-
entity_type: "customer"
47-
},
48-
{
49-
attribute_code: "region"
50-
entity_type: "customer_address"
51-
},
52-
{
53-
attribute_code: "media_gallery",
54-
entity_type: "catalog_product"
55-
}
56-
]
57-
)
58-
{
59-
items
60-
{
61-
attribute_code
62-
entity_type
63-
attribute_type
64-
attribute_options
65-
}
66-
}
34+
customAttributeMetadata(
35+
attributes: {
36+
attribute_code: "color"
37+
entity_type: "4"
38+
}
39+
) {
40+
items {
41+
attribute_code
42+
entity_type
43+
attribute_type
44+
attribute_options {
45+
value
46+
label
47+
}
48+
}
6749
}
50+
}
6851
{% endhighlight %}
6952

7053
**Response**
@@ -75,29 +58,71 @@ The following query returns the attribute type for various custom and EAV attrib
7558
"customAttributeMetadata": {
7659
"items": [
7760
{
78-
"attribute_code": "available_sort_by",
79-
"entity_type": "catalog_category",
80-
"attribute_type": "EavDataAttributeOptionInterface"
81-
},
82-
{
83-
"attribute_code": "quantity_and_stock_status",
84-
"entity_type": "catalog_product",
85-
"attribute_type": "CatalogInventoryDataStockItemInterface[]"
86-
},
87-
{
88-
"attribute_code": "default_billing",
89-
"entity_type": "customer",
90-
"attribute_type": "CustomerDataAddressInterface"
91-
},
92-
{
93-
"attribute_code": "region",
94-
"entity_type": "customer_address",
95-
"attribute_type": "CustomerDataRegionInterface"
96-
},
97-
{
98-
"attribute_code": "media_gallery",
99-
"entity_type": "catalog_product",
100-
"attribute_type": "ProductMediaGallery"
61+
"attribute_code": "color",
62+
"entity_type": "4",
63+
"attribute_type": "Int",
64+
"attribute_options": [
65+
{
66+
"value": "49",
67+
"label": "Black"
68+
},
69+
{
70+
"value": "214",
71+
"label": "blue"
72+
},
73+
{
74+
"value": "215",
75+
"label": "green"
76+
},
77+
{
78+
"value": "213",
79+
"label": "red"
80+
},
81+
{
82+
"value": "50",
83+
"label": "Blue"
84+
},
85+
{
86+
"value": "51",
87+
"label": "Brown"
88+
},
89+
{
90+
"value": "52",
91+
"label": "Gray"
92+
},
93+
{
94+
"value": "53",
95+
"label": "Green"
96+
},
97+
{
98+
"value": "54",
99+
"label": "Lavender"
100+
},
101+
{
102+
"value": "55",
103+
"label": "Multi"
104+
},
105+
{
106+
"value": "56",
107+
"label": "Orange"
108+
},
109+
{
110+
"value": "57",
111+
"label": "Purple"
112+
},
113+
{
114+
"value": "58",
115+
"label": "Red"
116+
},
117+
{
118+
"value": "59",
119+
"label": "White"
120+
},
121+
{
122+
"value": "60",
123+
"label": "Yellow"
124+
}
125+
]
101126
}
102127
]
103128
}

0 commit comments

Comments
 (0)