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!])
- operation (CollectionReorderOperationInput)
- •ID!required
The ID of the collection on which to reorder products.
- Anchor to movesmoves•[Move
Input!] 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.
Send either
movesoroperation, not both.Show input fields
- Anchor to operationoperation•Collection
Reorder Operation Input A declarative reorder that gives the place where products end up. Use
to move a block of products to the top, to the bottom or to an index, orto give products their final indexes. Send eithermovesoroperation, not both.Up to 1,000 products are supported. To reorder more products, send successive
requests at indexes 0, 1,000, 2,000 and so on, each one after the job of the request before it is done.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