Development discussions around Shopify APIs
Is there any way to add a product in all the sales channel using graphql muration.
after hours with chat talking with support, and nobody knows and helps, I could publish the solution...
Imagina that I needed to use deprecated fields because the fields that are supposed to be used, didn't work...
mutation publishablePublish($id: ID!, $input: [PublicationInput!]!) {
publishablePublish(id: $id, input: $input) {
publishable {
availablePublicationCount
publicationCount
publishedOnCurrentPublication
}
shop {
id
}
userErrors {
field
message
}
}
}
Call:
async function publishToChannelHelper(variables) {
try {
//COST - 37
await getApiPoints(37);
let myTesting = await axios.post('http://localhost:3060/graphql', {"query": gq.publishChannel, "variables": variables}
).then( async (res) => {
console.log(res.data)
return res.data
})
console.log("THIS IS TESTING")
console.log(myTesting.errors[0])
return myTesting
} catch (err) {
throw err
}
}
User | RANK |
---|---|
60 | |
11 | |
7 | |
7 | |
6 |
Thanks to all who participated in our AMA with 2H Media on planning your 2023 marketing bu...
By Jacqui Mar 30, 2023Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023