collection Update
Requires access scope. Also: The app must have access to the input fields used to update the collection. Further, the store must not be on the Starter or Retail plans and user must have a permission to update collection.
Updates a collection, modifying its properties, products, or publication settings. Collections help organize products together in the online store and other sales channels.
Use the mutation to programmatically modify collections in scenarios such as:
- Updating collection details, like title, description, or image
- Modifying SEO metadata for better search visibility
- Changing which products are included (using rule updates for smart collections)
- Publishing or unpublishing collections across different sales channels
- Updating custom data using metafields
There are two types of collections with different update capabilities:
- Custom (manual) collections: You can update collection properties, but rule sets can't be modified since products are manually selected.
- Smart (automated) collections: You can update both collection properties and the rules that automatically determine which products are included.
When updating rule sets for smart collections, the operation might be processed asynchronously. In these cases, the mutation returns a
job
object that you can use to track the progress of the update.
To publish or unpublish collections to specific sales channels, use the dedicated
and
mutations.
Learn more about using metafields with smart collections.
Arguments
- Anchor to inputinput•Collection
Input! required The updated properties for the collection.
- Anchor to collectioncollection•Collection
The updated collection.
- •Job
The asynchronous job updating the products based on the new rule set.
- Anchor to userErrorsuser•[User
Errors Error!]! non-null The list of errors that occurred from executing the mutation.