magento2
magento2 copied to clipboard
Graphql products query returns only ids for dropdows or multiselect fields
Preconditions (*)
- 2.3.5-p1 with sample data
Steps to reproduce (*)
- u can use this magento instance (https://magento2.kask.at/graphql) or your own testing instance with sample data. query /graphql for a product that has the gender attribute (multiselect) e.g. "dual-handle-cardio-ball"
query productDetail($url_key: String) {
productDetail: products(filter: {url_key: {eq: $url_key}}) {
items {
name
url_key
gender
}
}
}
variables:
{
"url_key": "dual-handle-cardio-ball"
}
Expected result (*)
I would expext the result to contain the labels
{
"data": {
"productDetail": {
"items": [
{
"name": "Dual Handle Cardio Ball",
"url_key": "dual-handle-cardio-ball",
"gender": ["Men","Women","Unisex"]
}
]
}
}
}
Actual result (*)
the response only returns the value ids.
{
"data": {
"productDetail": {
"items": [
{
"name": "Dual Handle Cardio Ball",
"url_key": "dual-handle-cardio-ball",
"gender": "5507,5508,5511"
}
]
}
}
}
Hi @maximilianmikus. 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.
@maximilianmikus do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
- [ ] yes
- [ ] no
- Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento give me 2.4-develop instance
Magento instance deployment temporary unavailable due to service maintenance.
@magento give me 2.4-develop instance
Magento instance deployment temporary unavailable due to service maintenance.
@magento give me 2.4-develop instance
Magento instance deployment temporary unavailable due to service maintenance.
@magento give me 2.4-develop instance
Hi @maximilianmikus. Thank you for your request. I'm working on Magento 2.4-develop instance for you
Hi @maximilianmikus, here is your Magento instance.
Admin access: https://i-28200-2-4-develop.instances.magento-community.engineering/admin_b3e5
Login: cf115cc0
Password: 32c908c14326
Instance will be terminated in up to 3 hours.
I can confirm this happens on 2.4-develop
the query:
query productDetail($url_key: String) {
productDetail: products(filter: {url_key: {eq: $url_key}}) {
items {
name
url_key
mycolor
mysize
}
}
}
with variables
{
"url_key": "simple-product-28"
}
yields
{
"data": {
"productDetail": {
"items": [
{
"name": "Simple Product 28",
"url_key": "simple-product-28",
"mycolor": 6,
"mysize": 9
}
]
}
}
}
It should actually contain the labels. "my yellow" and "my large"
Hi @paliarush. 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: :point_down:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears.
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- 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.
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
-
- Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced 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!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Hi @danielrenaud. 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: :point_down:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears.
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- 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.
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
-
- Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced 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!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Hi @sasha19957099. 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: :point_down:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears.
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- 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.
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
-
- Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced 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!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
It's really a good improvement however, unfortunately, it will bring breaking changes, so we cannot accept it for 2.4. (unless it will be approved)
Maybe we can do the following: mark all dynamic product attributes as deprecated and introduce an object that will hold all dynamic product attributes, something like
dynamic_attributes: [
{
code
value
type // is it useful for rendering UI?
}
]
Only one drawback that we need to support different types like texts, lists, float.. (we can see them in Admin => Store => Attributes => Product) and we can agree to have "value" as an array of strings which will cover all cases, however on the client-side we need to have something like value[0] each time for one-value attributes.
@DrewML what do you think about it?
This is an interesting one! I believe we've discussed before that, ideally, we'd get rid of attributes as fields, since it makes breaking change detection and multi-store frontends difficult to do.
I believe the general idea has been to go with something like you've recommended @mslabko. Will probably take a little bit of back and forth, though, to flesh out the right design.
In the meantime, it seems like this reported issue (a String
returning a comma-delimited list of IDs) certainly has to be a bug, which may make it ok to fix in a non-major release.
Thoughts @nrkapoor?
Hi @melnikovi. 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: :point_down:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears.
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- 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.
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
-
- Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced 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!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
I would like to kindly ask to make this high priority please - its really important otherwise product-information is not correctly displayed in the frontend. Could you maybe create a patch with some preliminary fix or something of the sort, while you sort out the better solutions. I tried doing this but lack deeper inside into the codebase to make it work.
For anyone stuck here, try this quickfix till its resolved in the core.
there was a typo in the link: https://github.com/theshreyas/magento-2-quickies/tree/main/GraphQl/DynamicAttributesGraphql
Hi there, is there a patch or solusion for this now? Thanks
Hi there, is there a patch or solusion for this now? Thanks
/push
please set this to higher prio 🚀
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2796 is successfully created for this GitHub issue.
https://jira.corp.adobe.com/browse/AC-2796
:white_check_mark: Confirmed by @cpartica. Thank you for verifying the issue.
Issue Available: @cpartica, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
hello, any idea on this issue and when its expected to be fixed ?
@cpartica, as you mentioned in JIRA comment, that we need an approved schema for this one, and alignment with the pwa metapackage schema. This will take time and moving it to 2.4.6.
Hence moving the associated PR to on Hold, until the further updates on JIRA.
Hi there, is there a patch or solusion for this now? Thanks
Over 2 years and counting and still no good support for two entire fundamental attribute data types and the can continues to be kicked down the road.
As mentioned in above https://github.com/magento/magento2/issues/28200#issuecomment-1134530825, we are doing follow up with team. We are waiting for the PO's input on the same. Once will get the clarity on that, we will proceed further on this.
Thank you!