Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Graphql] Category_uid is not available as a product aggregation type #32557

Closed
1 of 5 tasks
damienwebdev opened this issue Mar 19, 2021 · 9 comments
Closed
1 of 5 tasks
Labels
Component: GraphQL GraphQL Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: GraphQL Reproduced on 2.4.2 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.

Comments

@damienwebdev
Copy link
Member

damienwebdev commented Mar 19, 2021

Preconditions (*)

v2.4.2

Steps to reproduce (*)

query GetProductsInCategory($categoryUid: String!) {
  products(filter: {category_uid: {eq: $categoryUid}}) {
    aggregations {
        __typename
        attribute_code
    }
    __typename
  }
}

Expected result (*)

I expect to get category_uid back as an aggregation.

Actual result (*)


{
    "data": {
        "products": {
            "aggregations": [
                {
                    "__typename": "Aggregation",
                    "attribute_code": "price"
                },
                {
                    "__typename": "Aggregation",
                    "attribute_code": "category_id"
                },
                {
                    "__typename": "Aggregation",
                    "attribute_code": "packaging"
                },
                {
                    "__typename": "Aggregation",
                    "attribute_code": "new_brand"
                },
                {
                    "__typename": "Aggregation",
                    "attribute_code": "new_model"
                }
            ],
            "__typename": "Products"
        }
    }
}

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”.

Other information

Note that:

query GetFilterTypesForCategory {
  __type (name: "ProductAttributeFilterInput") {
      inputFields {
        name
        type {
            name
        }   
      }
  }
}

Returns the category_uid

{
    "data": {
        "__type": {
            "inputFields": [
                {
                    "name": "accessories_size",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "bed_bath_type",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "category_id",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "category_uid",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "color",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "description",
                    "type": {
                        "name": "FilterMatchTypeInput"
                    }
                },
                {
                    "name": "format",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "gender",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "length",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "material",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "name",
                    "type": {
                        "name": "FilterMatchTypeInput"
                    }
                },
                {
                    "name": "new_brand",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "new_model",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "price",
                    "type": {
                        "name": "FilterRangeTypeInput"
                    }
                },
                {
                    "name": "short_description",
                    "type": {
                        "name": "FilterMatchTypeInput"
                    }
                },
                {
                    "name": "size",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "sku",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "style",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                },
                {
                    "name": "url_key",
                    "type": {
                        "name": "FilterEqualTypeInput"
                    }
                }
            ]
        }
    }
}
@m2-assistant
Copy link

m2-assistant bot commented Mar 19, 2021

Hi @damienwebdev. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-assistant
Copy link

m2-assistant bot commented May 31, 2021

Hi @engcom-Golf. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: 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 branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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.

@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in GraphQL Backlog May 31, 2021
@engcom-Golf engcom-Golf added the Issue: needs update Additional information is require, waiting for response label Jun 9, 2021
@engcom-Golf
Copy link
Contributor

@damienwebdev Please share correct Request Payload with example. on using this, getting error:
image

so I modified my request payload & configure the attribute_code against Product from Admin Panel.
image

Please check whether you configure attribute codes or not.

@damienwebdev
Copy link
Member Author

@engcom-Golf the sample request provided expects you to use GraphQl variables, please do so -- my current request payload is correct.

Regardless, the issue isn't an admin attribute, it is the category_uid attribute introduced by the GraphQl team in v2.4.2.

This isn't an attribute configurable in the admin panel.

@cpartica can explain if there is any confusion.

@engcom-Golf
Copy link
Contributor

engcom-Golf commented Jun 9, 2021

@damienwebdev Thanks for quick reply.
@cpartica I tried reproducing this issue on Magento 2.4.2. Unable to get category_uid
image

Shall I consider this issue as Confirmed or is there any other way to show category_uid aggregations

@engcom-Golf engcom-Golf added Reproduced on 2.4.2 Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: needs update Additional information is require, waiting for response labels Jun 17, 2021
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in GraphQL Backlog Jun 17, 2021
@sdzhepa sdzhepa removed this from Ready for Development in GraphQL Backlog Nov 8, 2021
@m2-community-project m2-community-project bot removed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: ready for confirmation labels Nov 8, 2021
@sdzhepa sdzhepa added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Progress: ready for dev labels Nov 8, 2021
@cpartica cpartica added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. and removed Priority: P3 May be fixed according to the position in the backlog. labels Feb 10, 2022
@m2-community-project m2-community-project bot added this to Ready for Development in High Priority Backlog Feb 10, 2022
@m2-community-project m2-community-project bot removed this from Ready for Development in Low Priority Backlog Feb 10, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Feb 28, 2022
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Mar 2, 2022
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Mar 2, 2022
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Dev In Progress in High Priority Backlog Mar 10, 2022
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Dev In Progress in High Priority Backlog Mar 10, 2022
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Mar 10, 2022
@engcom-Alfa
Copy link
Contributor

Hi @damienwebdev ,
Thanks for your reported bug, the internal team has fixed and delivered this issue successfully.
Please find related commits HERE.

Kindly upgrade to the latest Magento version 2.4-develop to retest the case.

In case of any Magento related issues found in 2.4-develop, you may report a new bug with all the information like Preconditions, detailed steps to reproduce, expected and actual Results along with screenshots/ screen recordings.

For any Magento related references, you may refer to the Magento user guide.

Thanks!

@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in High Priority Backlog Apr 6, 2022
@joggienl
Copy link

I am trying out this fix and the aggregation now shows category_uid in stead of category_id. BUT the values are still the category id values, and not the uid values, is that correct and intended? This way they are not usable.

Example query:

query searchProducts {
    products(search: "") {
        aggregations {
          attribute_code 
          options {
            value
          }
        }
    }
}

Result I see (not a complete result:

{
  "data": {
    "products": {
      "aggregations": [
        {
          "attribute_code": "category_uid",
          "options": [
            {
              "value": "48"
            },
            {
              "value": "58"
            },
            {
              "value": "47"
            }
          ]
        }
      ]
    }
  }
}

In my case I would expect values like NDg= for 48, NTg= for 58 and NDc= for 47.

@damienwebdev have you had the change to check this "fix"? If you do get the proper values it might be something wrong on my end.

@damienwebdev
Copy link
Member Author

@joggienl I haven't re-reviewed.

@joggienl
Copy link

@damienwebdev thanks for your quick reply!

I've tried the call I used on https://venia.magento.com/graphql and there I do get the actual uid's.

So that is weird to say the least.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: GraphQL GraphQL Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: GraphQL Reproduced on 2.4.2 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
Development

No branches or pull requests

7 participants