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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.
type Query {
customer: Customer @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\Customer") @doc(description: "The customer query returns information about a customer account")
}
type Mutation {
generateCustomerToken(email: String!, password: String!): CustomerToken @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\GenerateCustomerToken") @doc(description:"Retrieve the customer token")
changeCustomerPassword(currentPassword: String!, newPassword: String!): Customer @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ChangePassword") @doc(description:"Changes the password for the logged-in customer")
createCustomer (input: CustomerInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomer") @doc(description:"Create customer account")
updateCustomer (input: CustomerInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Update the customer's personal information")
revokeCustomerToken: RevokeCustomerTokenOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RevokeCustomerToken") @doc(description:"Revoke the customer token")
createCustomerAddress(input: CustomerAddressInput!): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomerAddress") @doc(description: "Create customer address")
updateCustomerAddress(id: Int!, input: CustomerAddressInput): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerAddress") @doc(description: "Update customer address")
deleteCustomerAddress(id: Int!): Boolean @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\DeleteCustomerAddress") @doc(description: "Delete customer address")
}
input CustomerAddressInput {
firstname: String @doc(description: "The first name of the person associated with the shipping/billing address")
lastname: String @doc(description: "The family name of the person associated with the shipping/billing address")
company: String @doc(description: "The customer's company")
telephone: String @doc(description: "The telephone number")
street: [String] @doc(description: "An array of strings that define the street number and name")
city: String @doc(description: "The city or town")
region: CustomerAddressRegionInput @doc(description: "An object containing the region name, region code, and region ID")
postcode: String @doc(description: "The customer's ZIP or postal code")
country_id: CountryCodeEnum @doc(description: "The customer's country")
default_shipping: Boolean @doc(description: "Indicates whether the address is the default shipping address")
default_billing: Boolean @doc(description: "Indicates whether the address is the default billing address")
fax: String @doc(description: "The fax number")
middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address")
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
suffix: String @doc(description: "A value such as Sr., Jr., or III")
vat_id: String @doc(description: "The customer's Tax/VAT number (for corporate customers)")
custom_attributes: [CustomerAddressAttributeInput] @doc(description: "Address custom attributes")
}
input CustomerAddressRegionInput @doc(description: "CustomerAddressRegionInput defines the customer's state or province") {
region_code: String @doc(description: "The address region code")
region: String @doc(description: "The state or province name")
region_id: Int @doc(description: "Uniquely identifies the region")
}
input CustomerAddressAttributeInput {
attribute_code: String! @doc(description: "Attribute code")
value: String! @doc(description: "Attribute value")
}
type CustomerToken {
token: String @doc(description: "The customer token")
}
input CustomerInput {
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
firstname: String @doc(description: "The customer's first name")
middlename: String @doc(description: "The customer's middle name")
lastname: String @doc(description: "The customer's family name")
suffix: String @doc(description: "A value such as Sr., Jr., or III")
email: String @doc(description: "The customer's email address. Required")
dob: String @doc(description: "The customer's date of birth")
taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)")
gender: Int @doc(description: "The customer's gender(Male - 1, Female - 2)")
password: String @doc(description: "The customer's password")
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter")
}
type CustomerOutput {
customer: Customer!
}
type RevokeCustomerTokenOutput {
result: Boolean!
}
type Customer @doc(description: "Customer defines the customer name and address and other details") {
created_at: String @doc(description: "Timestamp indicating when the account was created")
group_id: Int @doc(description: "The group assigned to the user. Default values are 0 (Not logged in), 1 (General), 2 (Wholesale), and 3 (Retailer)")
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
firstname: String @doc(description: "The customer's first name")
middlename: String @doc(description: "The customer's middle name")
lastname: String @doc(description: "The customer's family name")
suffix: String @doc(description: "A value such as Sr., Jr., or III")
email: String @doc(description: "The customer's email address. Required")
default_billing: String @doc(description: "The ID assigned to the billing address")
default_shipping: String @doc(description: "The ID assigned to the shipping address")
dob: String @doc(description: "The customer's date of birth")
taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)")
id: Int @doc(description: "The ID assigned to the customer")
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed")
addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses")
}
type CustomerAddress @doc(description: "CustomerAddress contains detailed information about a customer's billing and shipping addresses"){
id: Int @doc(description: "The ID assigned to the address object")
customer_id: Int @doc(description: "The customer ID")
region: CustomerAddressRegion @doc(description: "An object containing the region name, region code, and region ID")
region_id: Int @doc(description: "A number that uniquely identifies the state, province, or other area")
country_id: String @doc(description: "The customer's country")
street: [String] @doc(description: "An array of strings that define the street number and name")
company: String @doc(description: "The customer's company")
telephone: String @doc(description: "The telephone number")
fax: String @doc(description: "The fax number")
postcode: String @doc(description: "The customer's ZIP or postal code")
city: String @doc(description: "The city or town")
firstname: String @doc(description: "The first name of the person associated with the shipping/billing address")
lastname: String @doc(description: "The family name of the person associated with the shipping/billing address")
middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address")
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
suffix: String @doc(description: "A value such as Sr., Jr., or III")
vat_id: String @doc(description: "The customer's Tax/VAT number (for corporate customers)")
default_shipping: Boolean @doc(description: "Indicates whether the address is the default shipping address")
default_billing: Boolean @doc(description: "Indicates whether the address is the default billing address")
custom_attributes: [CustomerAddressAttribute] @doc(description: "Address custom attributes")
extension_attributes: [CustomerAddressAttribute] @doc(description: "Address extension attributes")
}
type CustomerAddressRegion @doc(description: "CustomerAddressRegion defines the customer's state or province") {
region_code: String @doc(description: "The address region code")
region: String @doc(description: "The state or province name")
region_id: Int @doc(description: "Uniquely identifies the region")
}
type CustomerAddressAttribute {
attribute_code: String @doc(description: "Attribute code")
value: String @doc(description: "Attribute value")
}
enum CountryCodeEnum @doc(description: "The list of countries codes") {
AF @doc(description: "Afghanistan")
AX @doc(description: "Åland Islands")
AL @doc(description: "Albania")
DZ @doc(description: "Algeria")
AS @doc(description: "American Samoa")
AD @doc(description: "Andorra")
AO @doc(description: "Angola")
AI @doc(description: "Anguilla")
AQ @doc(description: "Antarctica")
AG @doc(description: "Antigua & Barbuda")
AR @doc(description: "Argentina")
AM @doc(description: "Armenia")
AW @doc(description: "Aruba")
AU @doc(description: "Australia")
AT @doc(description: "Austria")
AZ @doc(description: "Azerbaijan")
BS @doc(description: "Bahamas")
BH @doc(description: "Bahrain")
BD @doc(description: "Bangladesh")
BB @doc(description: "Barbados")
BY @doc(description: "Belarus")
BE @doc(description: "Belgium")
BZ @doc(description: "Belize")
BJ @doc(description: "Benin")
BM @doc(description: "Bermuda")
BT @doc(description: "Bhutan")
BO @doc(description: "Bolivia")
BA @doc(description: "Bosnia & Herzegovina")
BW @doc(description: "Botswana")
BV @doc(description: "Bouvet Island")
BR @doc(description: "Brazil")
IO @doc(description: "British Indian Ocean Territory")
VG @doc(description: "British Virgin Islands")
BN @doc(description: "Brunei")
BG @doc(description: "Bulgaria")
BF @doc(description: "Burkina Faso")
BI @doc(description: "Burundi")
KH @doc(description: "Cambodia")
CM @doc(description: "Cameroon")
CA @doc(description: "Canada")
CV @doc(description: "Cape Verde")
KY @doc(description: "Cayman Islands")
CF @doc(description: "Central African Republic")
TD @doc(description: "Chad")
CL @doc(description: "Chile")
CN @doc(description: "China")
CX @doc(description: "Christmas Island")
CC @doc(description: "Cocos (Keeling) Islands")
CO @doc(description: "Colombia")
KM @doc(description: "Comoros")
CG @doc(description: "Congo -Brazzaville")
CD @doc(description: "Congo - Kinshasa")
CK @doc(description: "Cook Islands")
CR @doc(description: "Costa Rica")
CI @doc(description: "Côte d’Ivoire")
HR @doc(description: "Croatia")
CU @doc(description: "Cuba")
CY @doc(description: "Cyprus")
CZ @doc(description: "Czech Republic")
DK @doc(description: "Denmark")
DJ @doc(description: "Djibouti")
DM @doc(description: "Dominica")
DO @doc(description: "Dominican Republic")
EC @doc(description: "Ecuador")
EG @doc(description: "Egypt")
SV @doc(description: "El Salvador")
GQ @doc(description: "Equatorial Guinea")
ER @doc(description: "Eritrea")
EE @doc(description: "Estonia")
ET @doc(description: "Ethiopia")
FK @doc(description: "Falkland Islands")
FO @doc(description: "Faroe Islands")
FJ @doc(description: "Fiji")
FI @doc(description: "Finland")
FR @doc(description: "France")
GF @doc(description: "French Guiana")
PF @doc(description: "French Polynesia")
TF @doc(description: "French Southern Territories")
GA @doc(description: "Gabon")
GM @doc(description: "Gambia")
GE @doc(description: "Georgia")
DE @doc(description: "Germany")
GH @doc(description: "Ghana")
GI @doc(description: "Gibraltar")
GR @doc(description: "Greece")
GL @doc(description: "Greenland")
GD @doc(description: "Grenada")
GP @doc(description: "Guadeloupe")
GU @doc(description: "Guam")
GT @doc(description: "Guatemala")
GG @doc(description: "Guernsey")
GN @doc(description: "Guinea")
GW @doc(description: "Guinea-Bissau")
GY @doc(description: "Guyana")
HT @doc(description: "Haiti")
HM @doc(description: "Heard & McDonald Islands")
HN @doc(description: "Honduras")
HK @doc(description: "Hong Kong SAR China")
HU @doc(description: "Hungary")
IS @doc(description: "Iceland")
IN @doc(description: "India")
ID @doc(description: "Indonesia")
IR @doc(description: "Iran")
IQ @doc(description: "Iraq")
IE @doc(description: "Ireland")
IM @doc(description: "Isle of Man")
IL @doc(description: "Israel")
IT @doc(description: "Italy")
JM @doc(description: "Jamaica")
JP @doc(description: "Japan")
JE @doc(description: "Jersey")
JO @doc(description: "Jordan")
KZ @doc(description: "Kazakhstan")
KE @doc(description: "Kenya")
KI @doc(description: "Kiribati")
KW @doc(description: "Kuwait")
KG @doc(description: "Kyrgyzstan")
LA @doc(description: "Laos")
LV @doc(description: "Latvia")
LB @doc(description: "Lebanon")
LS @doc(description: "Lesotho")
LR @doc(description: "Liberia")
LY @doc(description: "Libya")
LI @doc(description: "Liechtenstein")
LT @doc(description: "Lithuania")
LU @doc(description: "Luxembourg")
MO @doc(description: "Macau SAR China")
MK @doc(description: "Macedonia")
MG @doc(description: "Madagascar")
MW @doc(description: "Malawi")
MY @doc(description: "Malaysia")
MV @doc(description: "Maldives")
ML @doc(description: "Mali")
MT @doc(description: "Malta")
MH @doc(description: "Marshall Islands")
MQ @doc(description: "Martinique")
MR @doc(description: "Mauritania")
MU @doc(description: "Mauritius")
YT @doc(description: "Mayotte")
MX @doc(description: "Mexico")
FM @doc(description: "Micronesia")
MD @doc(description: "Moldova")
MC @doc(description: "Monaco")
MN @doc(description: "Mongolia")
ME @doc(description: "Montenegro")
MS @doc(description: "Montserrat")
MA @doc(description: "Morocco")
MZ @doc(description: "Mozambique")
MM @doc(description: "Myanmar (Burma)")
NA @doc(description: "Namibia")
NR @doc(description: "Nauru")
NP @doc(description: "Nepal")
NL @doc(description: "Netherlands")
AN @doc(description: "Netherlands Antilles")
NC @doc(description: "New Caledonia")
NZ @doc(description: "New Zealand")
NI @doc(description: "Nicaragua")
NE @doc(description: "Niger")
NG @doc(description: "Nigeria")
NU @doc(description: "Niue")
NF @doc(description: "Norfolk Island")
MP @doc(description: "Northern Mariana Islands")
KP @doc(description: "North Korea")
NO @doc(description: "Norway")
OM @doc(description: "Oman")
PK @doc(description: "Pakistan")
PW @doc(description: "Palau")
PS @doc(description: "Palestinian Territories")
PA @doc(description: "Panama")
PG @doc(description: "Papua New Guinea")
PY @doc(description: "Paraguay")
PE @doc(description: "Peru")
PH @doc(description: "Philippines")
PN @doc(description: "Pitcairn Islands")
PL @doc(description: "Poland")
PT @doc(description: "Portugal")
QA @doc(description: "Qatar")
RE @doc(description: "Réunion")
RO @doc(description: "Romania")
RU @doc(description: "Russia")
RW @doc(description: "Rwanda")
WS @doc(description: "Samoa")
SM @doc(description: "San Marino")
ST @doc(description: "São Tomé & Príncipe")
SA @doc(description: "Saudi Arabia")
SN @doc(description: "Senegal")
RS @doc(description: "Serbia")
SC @doc(description: "Seychelles")
SL @doc(description: "Sierra Leone")
SG @doc(description: "Singapore")
SK @doc(description: "Slovakia")
SI @doc(description: "Slovenia")
SB @doc(description: "Solomon Islands")
SO @doc(description: "Somalia")
ZA @doc(description: "South Africa")
GS @doc(description: "South Georgia & South Sandwich Islands")
KR @doc(description: "South Korea")
ES @doc(description: "Spain")
LK @doc(description: "Sri Lanka")
BL @doc(description: "St. Barthélemy")
SH @doc(description: "St. Helena")
KN @doc(description: "St. Kitts & Nevis")
LC @doc(description: "St. Lucia")
MF @doc(description: "St. Martin")
PM @doc(description: "St. Pierre & Miquelon")
VC @doc(description: "St. Vincent & Grenadines")
SD @doc(description: "Sudan")
SR @doc(description: "Suriname")
SJ @doc(description: "Svalbard & Jan Mayen")
SZ @doc(description: "Swaziland")
SE @doc(description: "Sweden")
CH @doc(description: "Switzerland")
SY @doc(description: "Syria")
TW @doc(description: "Taiwan")
TJ @doc(description: "Tajikistan")
TZ @doc(description: "Tanzania")
TH @doc(description: "Thailand")
TL @doc(description: "Timor-Leste")
TG @doc(description: "Togo")
TK @doc(description: "Tokelau")
TO @doc(description: "Tonga")
TT @doc(description: "Trinidad & Tobago")
TN @doc(description: "Tunisia")
TR @doc(description: "Turkey")
TM @doc(description: "Turkmenistan")
TC @doc(description: "Turks & Caicos Islands")
TV @doc(description: "Tuvalu")
UG @doc(description: "Uganda")
UA @doc(description: "Ukraine")
AE @doc(description: "United Arab Emirates")
GB @doc(description: "United Kingdom")
US @doc(description: "United States")
UY @doc(description: "Uruguay")
UM @doc(description: "U.S. Outlying Islands")
VI @doc(description: "U.S. Virgin Islands")
UZ @doc(description: "Uzbekistan")
VU @doc(description: "Vanuatu")
VA @doc(description: "Vatican City")
VE @doc(description: "Venezuela")
VN @doc(description: "Vietnam")
WF @doc(description: "Wallis & Futuna")
EH @doc(description: "Western Sahara")
YE @doc(description: "Yemen")
ZM @doc(description: "Zambia")
ZW @doc(description: "Zimbabwe")
}