Skip to content

GraphQl Custom Attributes Options output need optimization #39613

@zakdma

Description

@zakdma

Class \Magento\EavGraphQl\Model\Output\Value\Options\GetCustomSelectedOptionAttributes is not optimized for attributes with huge amounts of options (> 10000).
Request like this take too much time to retrieve such custom attributes selected values

query {
    products(
      filter: { category_id: { eq: "2"}}
    ) {
        total_count
        items {
            name
            sku
            custom_attributesV2(filters: {used_in_product_listing: true}) {
              items {
                code
                label
                ... on AttributeValue {
                      value
                    }
                ... on AttributeSelectedOptions {
                      selected_options {
                        label
                        value
                      }
                    }
              }
            }
        }
    }
 }

I suggest to optimize it.
The acceleration was from 3 to 4 times for my project.

Metadata

Metadata

Assignees

Labels

Area: CatalogComponent: AttributesIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Reported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions