collectionReorderProducts mutation
Asynchronously reorders a set of products from a given collection.
Required access
write_products access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
mutation collectionReorderProducts($id: ID!, $moves: [MoveInput!]!) { collectionReorderProducts(id: $id, moves: $moves) {} } { “id”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “moves”: [
<font style="color:#1F61A0;">job</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">id</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">field</font><font style="color:#1F61A0;">message</font><font style="color:#555555;">}</font>
] }
<font style="color:#555555;">{</font><font style="color:#8B2BB9;">"id"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE="</font><font style="color:#555555;">,</font><font style="color:#8B2BB9;">"newPosition"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">}</font>
Arguments
MoveInput fields
- id (
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)) REQUIRED
The ID of the object to be moved. - newPosition (
[UnsignedInt64!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#unsignedint64-2021-01)) REQUIRED
The new position of the object in the set, using a 0 based index.
Return fields
- job (
[Job](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/job))
The asynchronous job reordering the products. - userErrors (
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror))
List of errors that occurred executing the mutation.
