attributesForm
attributesForm is a Magento 2 GraphQL query in the Eav module. Retrieve EAV attributes associated to a frontend form. Use countries query provided by DirectoryGraphQl module to retrieve region_id and country_id attribute options. It returns AttributesFormOutput! and is callable anonymously.
Last verified: against Magento 2.4.9.
Returns
Resolver class
Magento\EavGraphQl\Model\Resolver\AttributesForm
Cache
identity: Magento\Eav\Model\Cache\AttributesFormIdentity
Arguments
Form code.
Example request
Auto-generated from the SDL — paste-ready against your store's /graphql endpoint. Replace the host, store code, and any required values before running.
Headers
Query
query ($formCode: String!) {
attributesForm(formCode: $formCode) {
items {
code
label
entity_type
frontend_input
frontend_class
is_required
default_value
is_unique
options {
label
value
is_default
}
}
errors {
type
message
}
}
}Variables
{
"formCode": ""
}Related in EavGraphQl
Other fields shipped by the same module.
attributesList
Returns a list of attributes metadata for a given entity type.
Eav · returns AttributesMetadataOutput
customAttributeMetadata
DeprecatedReturn the attribute type, given an attribute code and entity type.
Eav · returns CustomAttributeMetadata
customAttributeMetadataV2
Retrieve EAV attributes metadata.
Eav · returns AttributesMetadataOutput!
Every Magento dev tool, in one hosted workspace.
Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.