# 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") @cache(cacheable: false) isEmailAvailable ( email: String! @doc(description: "The new customer email") ): IsEmailAvailableOutput @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\IsEmailAvailable") } 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: "Deprecated: use `country_code` instead.") country_code: 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: "Deprecated: Custom attributes should not be put into container.") } 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: "region_id is deprecated. Region ID is excessive on storefront and region code should suffice for all scenarios") } 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 for customer creation") dob: String @doc(description: "Deprecated: Use `date_of_birth` instead") date_of_birth: 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 @deprecated(reason: "Customer group should not be exposed in the storefront scenarios") 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") @deprecated(reason: "Use `date_of_birth` instead") date_of_birth: String @doc(description: "The customer's date of birth") taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.") 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") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses") gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") } 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") @deprecated(reason: "customer_id is not needed as part of CustomerAddress, address ID (id) is unique identifier for the addresses.") region: CustomerAddressRegion @doc(description: "An object containing the region name, region code, and region ID") region_id: Int @deprecated(reason: "Region ID is excessive on storefront and region code should suffice for all scenarios") country_id: String @doc(description: "The customer's country") @deprecated(reason: "Use `country_code` instead.") country_code: CountryCodeEnum @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 Value-added 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] @deprecated(reason: "Custom attributes should not be put into container") 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 @deprecated(reason: "Region ID is excessive on storefront and region code should suffice for all scenarios") } type CustomerAddressAttribute { attribute_code: String @doc(description: "Attribute code") value: String @doc(description: "Attribute value") } type IsEmailAvailableOutput { is_email_available: Boolean @doc(description: "Is email availabel 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") }