MageSmith
QueryEav · Magento 2.4.9

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

AttributesFormOutput!

Resolver class

Magento\EavGraphQl\Model\Resolver\AttributesForm

Cache

identity: Magento\Eav\Model\Cache\AttributesFormIdentity

Arguments

formCode String! Required

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

Content-Type
application/json
Store
default store view code; use 'default' for the single-store baseline

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": ""
}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.