Hey, Im trying to use the storefront API to pull up a product variant using the variantBySelectedOptions field, but the documentation isn’t clear on the type of data it needs. It says it needs a product option’s name and value. I’m executing this query on a test product in graphiql:
{
node(id: “Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDkxMDg2NTI5”) {
id
… on Product {
title
id
handle
variantBySelectedOptions(selectedOptions:{name:“option1”,value:“Large”}){
id
}
}
}
}
I’m assuming here the option name is “option1”, but it’s unclear what’s needed here. I also don’t know what it’s expecting for the value.
Currently all combinations of data I’m inputting return a null response. Can anyone offer some assistance with this?