I’ve tried the mutation to create a collection, It seems there is no argument to make the new collection available online, I saw that with the REST API, we can use the arg “published”: true
Can you please explain me the way to do this with GraphQl ?
Next, you get the publication id where you want to publish the collection, in your case the Online Store. This can be done using the publications QueryRoot:
query{
publications(first:10){
edges{
node{
id
name
}
}
}
}
Here you have to provide an input variable with both the id of the collection you want to publish as the “id” key and then the id of the publication (Online Store) as “publicationId” key, both base64 encoded:
I am not able to get the collections list. I am getting the below error. I am using a private app on the Shopify Plus store. but, I am not seeing a scope which name is read_publications into the admin area. how can I give this permission to my private app?
Access denied for publications field. Required access: `read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores.
here is sample graphql query to create a collection
mutation {
collectionCreate(
input: {
title: "GQL New Collection",
descriptionHtml: "This is a new collection",
templateSuffix: null,
image: {src: "https://cdn.shopify.com/s/files/1/0594/7804/8868/products/8cd561824439482e3cea5ba8e3a6e2f6.jpg"}
}
) {
collection {
id
title
}
}
}