Skip to content

Commit for B2B-2404 causes issues with GraphQL Product Data Provider #37405

Open
@pmzandbergen

Description

@pmzandbergen

Summary

Starting from version 2.4.6 the Product Data Provider filters on the Visibility, this is not always desired (depending on the resolver). See commit:
8681d30#diff-f94c66fe63952d9bf9efbd6d9cb69ddcb479df56dde42b9d9327a7bf4a9446abR137

File:
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Deferred/Product.php#L138

Filtering (in this case on Visibility) is (in my opinion) something which should be handled by the Resolver, not the Data Provider.

Examples

There are multiple resolvers in 3rd party modules using the Product Data Provider. These modules expect the products to be returned, no matter their visibility. Please note that disabled or unassigned products is another story, those are expected to be filtered.

Proposed solution

Review if the filtering is desired and if so, move it to the Resolver.

Additional Information

For further commentary on this issue, this also impacts bundled products.

If you add a simple product that is visiblity - IN_CATALOG_ONLY that is not in any category on the site, then this will cause the product node of the BundleItemOption to return null since the underlying join is done against catalog_category_product_index_storeX which will not contain products if they are not assigned to any category.

This is not expected behavior because there may be a product that you want to sell as part of a bundle that isn't a part of any specific category since there's no need to list it anywhere.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.6Indicates 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