collection Reorder Products
Requires access scope. Also: The user must have a permission to reorder products within a collection.
Asynchronously reorders the products of a manually sorted collection. Instead
of returning an updated collection, this mutation returns a job, which should
be polled. The
must be MANUAL.
Positions are zero-based indexes in the collection's list of products. Products that the request doesn't list keep their relative order, and the reorder leaves no gaps. The description of each argument that reorders products says how it places them.
Arguments
- id (ID!)
- moves ([MoveInput!]!)
- •ID!required
The ID of the collection on which to reorder products.
- Anchor to movesmoves•[Move
Input!]! required A list of moves to perform, applied one at a time in the order given. Provide only the products that move; don't send the whole list.
is a zero-based index in the list as it is when the move applies, after all earlier moves in the list.values don't need to be unique. A value greater than or equal to the number of products moves the product to the end.- Products that aren't in
moveskeep their relative order, aside from the displacement that the moves cause.
Example:
- Initial order: [A, B, C, D, E] (indexes 0 to 4)
- Moves, applied in order: E to
, then C to - Result: [A, E, B, D, C]
Up to 250 moves are supported.
Show input fields
- job (Job)
- userErrors ([CollectionReorderProductsUserError!]!)
- •Job
The asynchronous job reordering the products.
Show fields
- Anchor to userErrorsuser•[Collection
Errors Reorder Products User Error!]! non-null The list of errors that occurred from executing the mutation.
Show fields