Open Betanoir opened 3 days ago
Hello @Betanoir
Just to make sure I understand the issue. You are saying that by default the value of metadata
is set to null
in the response. However, once you specify the fields *variants.metadata
, then only the value is populated?
Hey @thetutlage, that is correct
Yup, seems like an issue with the variants
node.
Package.json file
Node.js version
v21.7.3
Database and its version
PostgreSQL 13
Operating system name and version
Windows 11
Browser name
Chrome
What happended?
With the
sdk.store.products.list
api route, I had to specify in the fields that I want metadata returned on the product's variantsExpected behavior
I'm not sure if this is done intentionally, but the metadata attribute is always returned when retrieving a product or listing it using the various routes. If it is intentional, the metadata attribute shouldn't be returned. But if it isn't, the value of metadata should be returned.
My opinion is if an admin user is setting metadata, it should be returned by default in any case, but the metadata attribute is always returned when retrieving a product or listing it
Actual behavior
The values weren't returned, despite the attribute being there in the response with the value of
null
. I had to specify in the fields that I need metadata returned.Code ref:
Without
*variants.metadata
infields
:With
*variants.metadata
infields
:Link to reproduction repo
N/A