Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 5 tasks
griest024 opened this issue Jun 21, 2024 · 13 comments
Open
1 of 5 tasks
Assignees
Labels
Area: APIs Component: GraphQL GraphQL Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: dev in progress Reported on 2.4.6-p6 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@griest024
Copy link

griest024 commented Jun 21, 2024

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:

  • Moving the name field selection to the depth0 fragment:
query MagentoGetCategoryTree($filters: CategoryFilterInput!) {
    categoryList(filters: $filters) {
      ...depth0
      children {
        uid
      }
    __typename
  }
}
fragment depth0 on CategoryTree {
    ...depth1
    name
  __typename
}
...
  • Moving the name field selection to the body of the query:
query MagentoGetCategoryTree($filters: CategoryFilterInput!) {
    categoryList(filters: $filters) {
      ...depth0
      name
      children {
        uid
      }
    __typename
  }
}
...
  • Adding name to the selection set of the children (why?????):
query MagentoGetCategoryTree($filters: CategoryFilterInput!) {
    categoryList(filters: $filters) {
      ...depth0
      children {
        name
      }
    __typename
  }
}

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

  • 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”.
Copy link

m2-assistant bot commented Jun 21, 2024

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:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@griest024
Copy link
Author

@magento give me 2.4-develop instance

Copy link

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

Copy link

@griest024
Copy link
Author

reproed on the 2.4-develop instance

griest024 added a commit to graycoreio/daffodil that referenced this issue Jun 21, 2024
@engcom-Dash engcom-Dash self-assigned this Jun 22, 2024
Copy link

m2-assistant bot commented Jun 22, 2024

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: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@engcom-Dash engcom-Dash added the Reported on 2.4.6-p6 Indicates original Magento version for the Issue report. label Jun 27, 2024
@engcom-Dash engcom-Dash removed their assignment Jun 28, 2024
@engcom-Delta engcom-Delta self-assigned this Jun 28, 2024
Copy link

m2-assistant bot commented Jun 28, 2024

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Delta
Copy link
Contributor

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

@engcom-Delta engcom-Delta added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: GraphQL GraphQL Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: APIs labels Jul 1, 2024
@github-jira-sync-bot
Copy link

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

Copy link

m2-assistant bot commented Jul 1, 2024

✅ 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
Copy link
Contributor

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

Thanks

@engcom-Hotel engcom-Hotel added Issue: ready for confirmation and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jul 2, 2024
@engcom-Delta engcom-Delta self-assigned this Jul 16, 2024
@engcom-Delta
Copy link
Contributor

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

@engcom-Delta engcom-Delta added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Jul 17, 2024
@github-jira-sync-bot
Copy link

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

@engcom-Dash engcom-Dash added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: APIs Component: GraphQL GraphQL Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: dev in progress Reported on 2.4.6-p6 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Dev In Progress
Development

No branches or pull requests

5 participants