-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathattributes-metadata.graphqls
214 lines (171 loc) · 5.05 KB
/
attributes-metadata.graphqls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
type Query {
customAttributeMetadataV2(attributes: [AttributeMetadataInput!]!): CustomAttributeMetadata
customAttributesLists(listType: CustomAttributesListsEnum): CustomAttributeMetadata
}
type AttributeMetadataInput {
attribute_uid: ID
}
type CustomAttributeMetadata { # this replaces existing Attribute type
items: [AttributeMetadataInterface]
}
interface AttributeMetadataInterface { # base metadata common to all attributes
uid: ID # base64Encode(entityID/codeID)
label: String
data_type: ObjectDataTypeEnum # string, int, float, boolean etc
sort_order: Int
entity_type: EntityTypeEnum
ui_input: UiInputTypeInterface!
}
type CustomerAttributeMetadata implements AttributeMetadataInterface {
forms_to_use_in: [CustomAttributesListsEnum]
}
type CustomerAddressAttributeMetadata implements AttributeMetadataInterface {
}
type ProductAttributeMetadata implements AttributeMetadataInterface {
lists_to_use_in: [CustomAttributesListsEnum]
}
# interfaces for different types used in inputs --------------
interface UiInputTypeInterface {
ui_input_type: EntityTypeEnum
is_value_required: Boolean!
}
interface ValidationTextInputTypeInterface {
filter: InputValidationFilterEnum
}
interface FilterableTextInputTypeInterface {
input_validation: FilterableText
}
interface AttributeOptionsInterface {
attribute_options: [AttributeOptionInterface]
}
interface AttributeOptionInterface {
uid: ID!
is_default: Boolean
label: String
}
interface SelectableInputTypeInterface {
}
interface TextInputTypeInterface {
default_value: String
}
type FilterableText {
input_validation_type: InputValidationTypeEnum
minimum_text_length: Int
maximum_text_length: Int
}
type TextUiInputType implements UiInputTypeInterface, TextInputTypeInterface, FilterableTextInputTypeInterface, ValidationTextInputTypeInterface {
}
type TextAreaUiInputType implements UiInputTypeInterface, TextInputTypeInterface, FilterableTextInputTypeInterface, ValidationTextInputTypeInterface {
}
type MultipleLineUiInputType implements UiInputTypeInterface, TextInputTypeInterface, FilterableTextInputTypeInterface, ValidationTextInputTypeInterface {
lines_count: Int
}
type DateUiInputType implements UiInputTypeInterface, TextInputTypeInterface, FilterableTextInputTypeInterface {
minimum_date_allowed: String
maximum_date_allowed: String
}
type FileUiInputType implements UiInputTypeInterface, TextInputTypeInterface, FilterableTextInputTypeInterface {
maximum_file_size: Int # bytes
allowed_file_extensions: [String]
}
type ImageUiInputType implements UiInputTypeInterface, TextInputTypeInterface, FilterableTextInputTypeInterface {
maximum_file_size: Int # bytes
allowed_file_extensions: [String]
maximum_image_width: Int # in pixels
maximum_image_height: Int # in pixels
}
type DropDownUiInputType implements UiInputTypeInterface, SelectableInputTypeInterface, AttributeOptionsInterface {
}
type MultipleSelectUiInputType implements UiInputTypeInterface, SelectableInputTypeInterface, AttributeOptionsInterface {
}
interface SwatchInputTypeInterface {
update_product_preview_image: Boolean
}
type VisualSwatchUiInputType implements UiInputTypeInterface, SelectableInputTypeInterface, AttributeOptionsInterface, SwatchInputTypeInterface {
use_product_image_for_swatch_if_possible: Boolean
}
type TextSwatchUiInputType implements UiInputTypeInterface, SelectableInputTypeInterface, AttributeOptionsInterface, SwatchInputTypeInterface {
}
type AttributeOption implements AttributeOptionInterface {
value: String @deprecated(reason: "use `uid` instead")
label: String
}
interface SelectableInputTypeInterface {
}
type ColorSwatchAttributeOption implements AttributeOptionInterface {
color: String # html hex code format
}
type ImageSwatchAttributeOption implements AttributeOptionInterface {
image_path: String # relative path
}
type TextSwatchAttributeOption implements AttributeOptionInterface {
description: String
}
#enums to support above queries
enum ObjectDataTypeEnum {
STRING
FLOAT
INT
BOOLEAN
}
enum EntityTypeEnum {
CUSTOMER
CUSTOMER_ADDRESS
CATALOG_CATEGORY
CATALOG_PRODUCT
ORDER
INVOICE
CREDITMEMO
SHIPMENT
RMA_ITEM
GENERIC
}
enum UiInputTypeEnum {
TEXT
TEXTAREA
MULTILINE
DATE
DATETIME
SELECT
MULTISELECT
BOOLEAN
FILE
IMAGE
SWATCH_VISUAL
SWATCH_TEXT
PRICE
MEDIA_IMAGE
WEEE
}
enum InputValidationTypeEnum {
ALPHANUMERIC
ALPHANUMERIC_WITH_SPACES
NUMERIC_ONLY
ALLPHA_ONLY
DATE
URL
EMAIL
LENGTH_ONLY
}
enum InputValidationFilterEnum {
STRIPTAGS
ESCAPEHTML
DATE
}
enum CustomerAttributeFormsEnum {
CUSTOMER_ACCOUNT_CREATE
CUSTOMER_ACCOUNT_EDIT
ADMINHTML_CHECKOUT
}
enum CustomAttributesListsEnum {
PRODUCTS_COMPARE
PRODUCTS_LISTING
ADVANCED_CATALOG_SEARCH
PRODUCT_SORT
PRODUCT_FILTER
PRODUCT_SEARCH_RESULTS
PRODUCT_AGGREGATIONS
RMA_FORM
CUSTOMER_REGISTRATION_FORM
CUSTOMER_ADDRESS_FORM
}