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

Configurable Products counted but not retrieved in GraphQL (works with REST endpoint) #238

Closed
koen-dev opened this issue Nov 6, 2018 · 3 comments
Assignees
Labels
bug Something isn't working Component: CatalogGraphQl

Comments

@koen-dev
Copy link

koen-dev commented Nov 6, 2018

Preconditions (*)

  1. Magento Commerce 2.3.0 beta32
  2. Custom instance with custom attributes and attribute sets

Attributes used:

  • Growth method: Dropdown
  • Height: Dropdown

Steps to reproduce (*)

  1. Create Product (Required fields + Categories)
  2. Create Configurations for Product
  3. Select Custom Attributes for Configurations
  4. Select Custom Attributes Values
  5. Skipped image uploading
  6. Enter price for each configuration
  7. Enter quantity for each configuration
  8. Generate Products
  9. Retrieve Category with products using GraphQL
{
  category(id: 5) {
    product_count
    products {
      items {
        name
      }
    }
  }
}

Expected result (*)

  1. Category with products as name and product_count
{
  "data": {
    "category": {
      "product_count": 1,
      "products": {
        "items": [
          {
            "name": "Buxushaag kant-en-klaar"
          }
        ]
      }
    }
  }
}

Actual result (*)

  1. Category with product_count matching Magento admin but without products
{
  "data": {
    "category": {
      "product_count": 1,
      "products": {
        "items": []
      }
    }
  }
}

Extra information

This isn't only related to CategoryTree it also happens with Products.
When retrieving the product using the REST API it works as expected.

@rogyar
Copy link
Contributor

rogyar commented Nov 7, 2018

Please, doublecheck that at least one simple product is in stock and has qty greater than zero.
This issue appears when the product is out of stock. The products count has a positive value but no products are on the list

@rogyar rogyar self-assigned this Nov 7, 2018
@koen-dev
Copy link
Author

koen-dev commented Nov 8, 2018

@rogyar I can confirm this has been resolved by adding quantity to everything.

@rogyar
Copy link
Contributor

rogyar commented Nov 8, 2018

Also, this behavior is not the final one.
The product count value has been adjusted to reflect the fetched products number in the following PR

#243

@naydav naydav added the 2.3.1 label Dec 7, 2018
@naydav naydav added this to the Release: 2.3.1 milestone Dec 7, 2018
@naydav naydav added 2.3.1 and removed 2.3.1 labels Dec 7, 2018
@TomashKhamlai TomashKhamlai added bug Something isn't working Component: CatalogGraphQl labels Mar 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Component: CatalogGraphQl
Projects
None yet
Development

No branches or pull requests

4 participants