attributesForm query
The attributesForm query retrieves EAV attributes associated with customer and customer address frontend forms.
These forms are visible when using the Admin to create or edit a customer or customer address (Stores > Attributes > Customer or Customer Address).
data-variant=info
data-slots=text
The following table maps the display names of the applicable forms to values that you can specify as a formCode value.
Type
Display name
formCode valueCustomer
Customer Account Edit
customer_account_editCustomer
Customer Registration
customer_account_createCustomer address
Customer Address Registration
customer_register_addressCustomer address
Customer Account Address
customer_address_editdata-slots=text
You cannot query on the Admin Checkout form.
Syntax
{attributesForm(formCode: String!): {AttributesFormOutput!}}
Reference
The attributesForm reference provides detailed information about the types and fields defined in this query.
Example usage
The following query returns the list of attributes metadata associated to the form customer_register_address.
Request:
{
attributesForm(formCode: "customer_register_address") {
items {
label
entity_type
frontend_input
is_required
}
errors {
type
message
}
}
}
Response:
{
"data": {
"attributesForm": {
"items": [
{
"label": "First Name",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": true
},
{
"label": "Last Name",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": true
},
{
"label": "Company",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": false
},
{
"label": "Street Address",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "MULTILINE",
"is_required": true
},
{
"label": "City",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": true
},
{
"label": "Country",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "SELECT",
"is_required": true
},
{
"label": "State/Province",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": false
},
{
"label": "State/Province",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "HIDDEN",
"is_required": false
},
{
"label": "Zip/Postal Code",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": false
},
{
"label": "Phone Number",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": true
},
{
"label": "VAT Number",
"entity_type": "CUSTOMER_ADDRESS",
"frontend_input": "TEXT",
"is_required": false
}
],
"errors": [
{
"type": "ATTRIBUTE_NOT_FOUND",
"message": "Attribute code \"middlename\" could not be found."
}
]
}
}
}