Collection Reorder Products Payload
Return type for mutation.
Anchor to FieldsFields
- 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
Anchor to Mutations with this payloadMutations with this payload
- collectionReorderProducts (CollectionReorderProductsPayload)
- •mutation
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 beMANUAL.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.
Show payload
- •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
Arguments
- •ID!