Description
Preconditions (*)
- Magento 2.4.1 and 2.4-develop
Steps to reproduce (*)
- Run the following query:
query GetCategoryTree($filters: CategoryFilterInput!) {
categoryList(filters: $filters) {
...recursiveCategoryNode
}
}
fragment recursiveCategoryNode on CategoryTree {
...categoryNode
children {
...categoryNode
}
}
fragment categoryNode on CategoryTree {
id
}
{code}
I used the following argument:
{code:json}
{
"filters": {
"ids": {
"eq": "2"
}
}
}
{code}
I did not test on sample data but you can probably infer an analogous argument that matches the sample data. It seems that this only fails when there are categories that match the filter.
Expected result
I expect to get a GraphQL response with category IDs.
Actual result
I get the following response:
{code:json}
{
"errors": [
{
"debugMessage": "Argument 2 passed to Magento\CatalogGraphQl\Model\Category\DepthCalculator::calculate() must be an instance of GraphQL\Language\AST\FieldNode, instance of GraphQL\Language\AST\FragmentSpreadNode given, called in /var/www/html/vendor/magento/module-catalog-graph-ql/Model/Category/DepthCalculator.php on line 41",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"categoryList"
]
}
>,
"data": {
"categoryList": null
}
}
{code}
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- < ] 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”.
Note that the following queries do not throw this error and complete as expected:
Using Two Fragments but Not Spreading into Root of recursiveCategoryNode
{code:graphql}
query GetCategoryTree($filters: CategoryFilterInput!) {
categoryList(filters: $filters) {
...recursiveCategoryNode
}
}
fragment recursiveCategoryNode on CategoryTree {
id
children {
...categoryNode
}
}
fragment categoryNode on CategoryTree {
id
}
{code}
and
Spreading into Root but Only Using One Fragment
{code:graphql}
query GetCategoryTree($filters: CategoryFilterInput!) {
categoryList(filters: $filters) {
...categoryNode
children {
...categoryNode
}
}
}
fragment categoryNode on CategoryTree {
id
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status