magento2
magento2 copied to clipboard
GraphQL Routes query with fragments has issue in the category page
Preconditions and environment
Environment: Magento Open Source 2.4.5
Preconditions: Use the category page URL in the param. Also, use fragments in the query
Steps to reproduce
- Here is the graphQL query. Please run it in the tool
query Route($url: String!) {
route(url: $url) {
redirect_code
relative_url
type
... on CategoryTree {
name
id
url_path
url_suffix
breadcrumbs {
category_name
category_url_path
category_uid
}
}
...on SimpleProduct{
...ProductFragment
}
}
}
fragment ProductFragment on SimpleProduct {
name
price_range {
minimum_price {
regular_price {
value
}
final_price {
value
}
}
}
description {
html
}
image {
url
}
media_gallery {
url
}
}
- Variable used:
{ "url": "men.html" }
Expected result
Returns category information.
{ "data": { "route": { "redirect_code": 0, "relative_url": "men.html", "type": "CATEGORY", "name": "Men", "id": 11, "url_path": "men", "url_suffix": ".html", "breadcrumbs": null } } }
Actual result
{ "errors": [ { "debugMessage": "Notice: Undefined property: GraphQL\\Language\\AST\\FragmentSpreadNode::$selectionSet in /var/www/html/mage245/vendor/magento/module-catalog-graph-ql/Model/Category/DepthCalculator.php on line 83", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 2, "column": 5 } ], "path": [ "route" ] } ], "data": { "route": null } }
Additional information
No response
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”.
Hi @jancyceymox. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
- Summary of the issue
- Information on your environment
- Steps to reproduce
- Expected and actual results
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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: 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.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-November. 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:
-
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears. -
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Description
label to the issue by yourself. -
[ ] 3. Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced 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.
hi @jancyceymox , Verified the issue on Magento 2.4-develop branch and 2.4.5 project-community-edition as well but the issue is not reproducible. Can you please provide the complete GraphQl query that you have used to reproduce the issue from our end. Thank you.
@engcom-November Here is the complete query. Please use your category URL instead of 'men.html'
{
route(url: "men.html") {
redirect_code
relative_url
type
... on CategoryTree {
name
id
url_path
url_suffix
breadcrumbs {
category_name
category_url_path
category_uid
}
}
...on SimpleProduct{
...ProductFragment
}
}
}
fragment ProductFragment on SimpleProduct {
name
price_range {
minimum_price {
regular_price {
value
}
final_price {
value
}
}
}
description {
html
}
image {
url
}
media_gallery {
url
}
}
Verified the issue on both Magento 2.4-develop branch with sample data and 2.4.5 project-community-edition and the issue is reproducible with below steps performed. Note: Intermittent issue. Steps performed:
- Created sub category under default category and run above graphql query:
Issue: Internal server error is observed.
Note: This issue is not observed for all category links. Issue observed for categories under default category with no / 1 product.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6507 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
:x: You don't have permission to export this issue.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-6507
@magento I am working on this
Hi @jancyceymox , Development team is working on this issue. Thank you.