Setting a new position for products in a collection using GraphQL API does not work

Topic summary

A developer is unable to set product positions within a Shopify collection using the GraphQL API, despite the collection being configured for manual sorting.

What works:

  • Adding products to collections via GraphQL (collectionAddProducts mutation)
  • Repositioning products using the REST API

What doesn’t work:

  • The collectionReorderProducts mutation in GraphQL fails to update product positions

Technical details:

  • The developer is attempting to move Product ID 9226170532176 to position 22 in Collection ID 615709376848
  • The mutation syntax appears correct, using the moves parameter with product ID and new position
  • The collection is confirmed to be set to manual order

Current status: The issue remains unresolved, with the developer seeking help to understand why GraphQL behaves differently than REST API for this operation.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

// Add product 9226170532176 to collection 615709376848
curl -X POST “xxxx” -H “Content-Type: application/json” -H “X-Shopify-Access-Token: ” -d “{"query": "mutation collectionAddProducts($id: ID!, $productIds: [ID!]!) { collectionAddProducts(id: $id, productIds: $productIds) { collection { id } userErrors { field message } } }", "variables": { "id": "gid://shopify/Collection/615709376848", "productIds": ["gid://shopify/Product/9226170532176"] }}”

// Move Product 9226170532176 in Collection 615709376848 to New Position 22
curl -X POST “xxxxx” -H “Content-Type: application/json” -H “X-Shopify-Access-Token: ” -d “{"query": "mutation collectionReorderProducts($id: ID!, $moves: [MoveInput!]!) { collectionReorderProducts(id: $id, moves: $moves) { job { id } userErrors { field message } } }", "variables": { "id": "gid://shopify/Collection/615709376848", "moves": [{"id": "gid://shopify/Product/9226170532176", "newPosition": "22"}] }}”

Somehow I cannot set a new position for my products using GraphQL. The Collection is set to manual order. Thanks for the help!

Hi! the collection is set to manual sorting. When I using the REST API it works, but when using the GraphQL API it does not.