MageSmith
QueryEav · Magento 2.4.9 Deprecated

customAttributeMetadata

customAttributeMetadata is a Magento 2 GraphQL query in the Eav module. Return the attribute type, given an attribute code and entity type. It returns CustomAttributeMetadata and is callable anonymously.

Deprecated: Use `customAttributeMetadataV2` query instead.

Last verified: against Magento 2.4.9.

Returns

CustomAttributeMetadata

Resolver class

Magento\EavGraphQl\Model\Resolver\CustomAttributeMetadata

Cache

identity: Magento\EavGraphQl\Model\Resolver\Cache\CustomAttributeMetadataIdentity

Arguments

attributes [AttributeInput!]! Required

An input object that specifies the attribute code and entity type to search.

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 ($attributes: [AttributeInput!]!) {
  customAttributeMetadata(attributes: $attributes) {
    items {
      attribute_code
      entity_type
      attribute_type
      input_type
      attribute_options {
        label
        value
      }
      storefront_properties {
        use_in_product_listing
        position
        visible_on_catalog_pages
        use_in_layered_navigation
        use_in_search_results_layered_navigation
      }
    }
  }
}

Variables

{
  "attributes": [
    {}
  ]
}

Every Magento dev tool, in one hosted workspace.

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