Open
Description
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 thedepth0
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 thechildren
(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”.