Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Category Tree Contains null Leaves #527

Closed
tjwiebell opened this issue Mar 22, 2019 · 1 comment
Closed

Category Tree Contains null Leaves #527

tjwiebell opened this issue Mar 22, 2019 · 1 comment
Assignees

Comments

@tjwiebell
Copy link
Contributor

Preconditions (*)

  1. Magento 2.3.1
  2. Create subcat1 Category and disable
  3. Create subcat1-1 under subcat1, leave enabled
  4. Create subcat2 Category, leave enabled

Steps to reproduce (*)

  1. Perform the below query:
# id = 2
query categoryList($id: Int!) {
    category(id: $id) {
        id
        children {
            id
            name
            productImagePreview: products(pageSize: 1) {
                items {
                    small_image {
                        url
                    }
                }
            }
        }
    }
}

Expected result (*)

  1. subcat2 is returned

Actual result (*)

  1. subcat2 and subcat1-1 are returned (sorta). See actual result below.
{
  "data": {
    "category": {
      "id": 2,
      "children": [
        {
          "id": 3,
          "name": null,
          "productImagePreview": {
            "items": [
              {
                "small_image": {
                  "url": "https://magento.test/static/version1553102240/graphql/_view/en_US/Magento_Catalog/images/product/placeholder/small_image.jpg"
                }
              }
            ]
          }
        },
        {
          "id": 4,
          "name": "subcat2",
          "productImagePreview": {
            "items": []
          }
        }
      ]
    }
  }
}

Removing the productImagePreview from the query seems to return the correct results.

@naydav
Copy link
Contributor

naydav commented Mar 30, 2019

#529

@naydav naydav closed this as completed Mar 30, 2019
@naydav naydav added this to the Release: 2.3.2 milestone Mar 30, 2019
@naydav naydav added the bug Something isn't working label Mar 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants