I am trying to add a product to a sales channel using Graphql Admin API, this is my request:
mutation MyMutation {
productPublish(input: {id: "%s", productPublications: {publicationId:
"gid:\/\/shopify\/Channel\/84635386114"}})
{
userErrors {
field
message
}
}
}
When I try to add it, I get this error
{"data":{"productPublish":null},"errors":[{"message":"invalid id","locations":[{"line":4,"column":17}],"path":["productPublish"]}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":1,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":999,"restoreRate":50.0}}}}
Do you have any idea why I get this error?
I request the channel Id and this is the response
{"data":{"channels":{"nodes":[{"id":"gid:\/\/shopify\/Channel\/84635386114","supportsFuturePublishing":true}]}},"extensions":{"cost":{"requestedQueryCost":12,"actualQueryCost":3,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":997,"restoreRate":50.0}}}}
And I’m sure the product id is correct