Admin GraphQL API - Mutation to create a manual (custom) collection

Solved

Admin GraphQL API - Mutation to create a manual (custom) collection

gsouf
Shopify Partner
5 0 1

Hi,

 

using the Admin GraphQL API we can create an "automatic" collection: https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/collectionCreate

 

But I can't find a way to create a manual (custom) collection. That is doable with the rest api: https://shopify.dev/docs/api/admin-rest/2024-07/resources/customcollection

 

Any idea how to do with the GraphQL API?

 

Thanks

Accepted Solution (1)

PaulNewton
Shopify Partner
6874 615 1450

This is an accepted solution.

Hi @gsouf Use the collectionCreate without a ruleSet input.

 

Then on the docs page there is a feedback button "Was this section helpful? Yes No"

Tell shopify how this was confusing so they could improve this by being explicit on common usages instead of writing the docs like every dev is just supposed to "know" how their made up abstraction behaves.

For real the collectionCreate doc doesn't even mention manual collections, ugh.

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


View solution in original post

Replies 2 (2)

PaulNewton
Shopify Partner
6874 615 1450

This is an accepted solution.

Hi @gsouf Use the collectionCreate without a ruleSet input.

 

Then on the docs page there is a feedback button "Was this section helpful? Yes No"

Tell shopify how this was confusing so they could improve this by being explicit on common usages instead of writing the docs like every dev is just supposed to "know" how their made up abstraction behaves.

For real the collectionCreate doc doesn't even mention manual collections, ugh.

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


gsouf
Shopify Partner
5 0 1

Thanks, I was indeed confused as in the collection's query there is a flag "collection_type" for that purpose and on the REST api they clearly make the difference between the two