May I know if it was possible to get the “productVariant metafields” by using Jquery Ajax and graphQL?
I am able to use the graphQL below to get the response object by using Python and Postman.
query {
productVariant(id: “gid://shopify/ProductVariant/11111111111111”) {
metafields(first: 10) {
edges {
node {
namespace
key
value
}
}
}
}
}
However, I cannot apply it by using jquery. I try to put the code below in one of my template liquid files but return nothing.
Beside ajax, I also try to use fetch. Unfortunately, both of their response is EMPTY.
Can anyone teach me how to make it work? Thanks a lot.