magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.45k stars 9.29k forks source link

Category fields missing data when in deeply (>1) nested GraphQL fragments #38863

Open griest024 opened 2 months ago

griest024 commented 2 months ago

Preconditions and environment

Magento version: 2.4.6-p6

Steps to reproduce

Send a GraphQL request with the following query:

query MagentoGetCategoryTree($filters: CategoryFilterInput!) {
    categoryList(filters: $filters) {
      ...depth0
      children {
        uid
      }
    __typename
  }
}
fragment depth0 on CategoryTree {
    ...depth1
  __typename
}
fragment depth1 on CategoryTree {
  ...depth2
  name
  __typename
}
fragment depth2 on CategoryTree {
    name
    uid
  __typename
}

and the following variables:

{
    "filters":{"ids":{"eq":"4"}}
}

Expected result

{
    "data": {
        "categoryList": [
            {
                "name": "Bags",
                "uid": "NA==",
                "__typename": "CategoryTree",
                "children": []
            }
        ]
    }
}

Actual result

{
    "data": {
        "categoryList": [
            {
                "name": null,
                "uid": "NA==",
                "__typename": "CategoryTree",
                "children": []
            }
        ]
    }
}

Additional information

This is almost certainly related to #31086.

Any of the following causes name to be filled with the correct data:

Its interesting that some fields can be selected in deeply nested fragments, such as uid. The following query gives the correct value for uid:

query MagentoGetCategoryTree($filters: CategoryFilterInput!) {
    categoryList(filters: $filters) {
      ...depth0
    __typename
  }
}
fragment depth0 on CategoryTree {
    ...depth1
}
fragment depth1 on CategoryTree {
  ...depth2
}
fragment depth2 on CategoryTree {
  ...depth3
}
fragment depth3 on CategoryTree {
  ...depth4
}
fragment depth4 on CategoryTree {
  ...depth5
}
fragment depth5 on CategoryTree {
  ...depth6
}
fragment depth6 on CategoryTree {
  ...depth7
}
fragment depth7 on CategoryTree {
    uid
}

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 months ago

Hi @griest024. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

griest024 commented 2 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 months ago

Hi @griest024. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 months ago

Hi @griest024, here is your Magento Instance: https://d20bcd2a6e2531fad2efc882e1a1a3eb.instances-prod.magento-community.engineering Admin access: https://d20bcd2a6e2531fad2efc882e1a1a3eb.instances-prod.magento-community.engineering/admin_453f Login: 7eb7b20f Password: 4754edd6aec4

griest024 commented 2 months ago

reproed on the 2.4-develop instance

m2-assistant[bot] commented 2 months ago

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


m2-assistant[bot] commented 2 months ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Delta commented 2 months ago

Hi @griest024 ,

Verified the issue on 2.4-develop and it is reproducible.

Hence, Confirming the issue.

Steps to reproduce:-

1.go to graphql 2.Send a GraphQL request with deeply (>1) nested GraphQL fragments

Screenshot 2024-07-01 at 5 33 35 PM Screenshot 2024-07-01 at 5 36 05 PM
github-jira-sync-bot commented 2 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12316 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 months ago

:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

engcom-Hotel commented 2 months ago

@engcom-Delta As per discussion in the triage call please rework this issue. Till the time moving it to Ready for confirmation.

Thanks

engcom-Delta commented 1 month ago

Hi @griest024 ,

Thanks for your reporting and collaboration. We have verified the issue in latest 2.4-develop instance and it is reproducible.

Hence, Confirming the issue.

Steps to reproduce:-

1.Go to graphql 2.Run GraphQL request with deeply (>1) nested GraphQL fragments image

github-jira-sync-bot commented 1 month ago

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-12316