I’m trying to follow the guide to sync data from an external source using the productSet migration https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/sync-data
My mutation looks like this:
mutation createProductAsynchronous($productSet: ProductSetInput!, $synchronous: Boolean!) {
productSet(synchronous: $synchronous, input: $productSet) {
product {
id
}
productSetOperation {
id
status
userErrors {
code
field
message
}
}
userErrors {
code
field
message
}
}
}
I want to sync title, description and price so my productSet looks like this.
const productSet = {
title: product.name,
descriptionHtml: product.description,
vendor: product.vendor,
productOptions: [{
name: "Dummy",
position: 1,
values: [{
name: "High"
}]
}],
variants: [{
optionValues: [{
optionName: "Dummy",
name: "High"
}],
price: product.price
}]
}
I don’t want the dummy “productOptions” to be needed as it shows up on the product listing. But if i omit productOptions/optionValues i get an error like:
Variable $productSet of type ProductSetInput! was provided invalid value for variants.0.optionValues (Expected value to not be null)
How can i create a simple product with one price and no options/variants?