Closed getwebM closed 7 months ago
I have the same problem: my custom fields are exposed for the products correctly with the product
or through the activeOrder
queries, but missing through the order
and orderByCode
queries.
I think the problem here (in both cases) is that the custom fields are being defined on the Product
entity, but both the collection
and (I am guessing) your order
queries are actually querying ProductVariant
rather than Product
.
For example, to get the custom fields of the Product
from the activeOrder
query you would do:
query {
activeOrder {
id
lines {
productVariant {
product {
customFields {
myCustomField
}
}
}
}
}
}
Hi @michaelbromley ,
Thanks for your quick feedback. Hum, I guess my query already was correct, see, if I query the product directly by ID, I get its shortname
:
On the other hand, If I have the product in my order lines with order
or orderByCode
, the shortname
is there null.
Am I missing something? Thanks in advance!
@daviddarx ok yeah your queries look correct so this seems like a potential bug then. I will investigate at the next opportunity.
Alternatively let's try putting a bounty on it to incentivize others to have a go at solving it:
/bounty $40
/attempt #2171
with your implementation plan/claim #2171
in the PR body to claim the bountyThank you for contributing to vendure-ecommerce/vendure!
Add a bounty • Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
🔴 @jemiluv8 | Jan 16, 2024, 4:51:27 PM | WIP |
🔴 @oliverqx | Jan 23, 2024, 4:14:20 PM | #2644 |
@michaelbromley Great thanks!
/attempt #2171
💡 @oliverqx submitted a pull request that claims the bounty. You can visit your bounty board to reward.
Describe the bug customFields is null on graphQl query collection
Product with customFields:
Query:
Response:
To Reproduce Steps to reproduce the behavior:
Expected behavior List of customFields as JSON
Environment (please complete the following information):