Having issue with graphQL Mutations for collectionReorderProducts

chirag_viradiya
Shopify Partner
17 2 4

Guys,

I'm implementing graphQL in my public app but having issue with implementation/mutations don't know.
Let me write here mutation,

mutation {
  collectionReorderProducts(id: "gid://shopify/Collection/280503451819", moves: [
    {
      id: "gid://shopify/Product/6878982013099",
      newPosition: "5"
    },
    {
      id: "gid://shopify/Product/6878981685419",
      newPosition: "2"
    }
  ]) {
    userErrors {
      field
      message
    }
    job {
      # Job fields
      done
    }
    
  }
}


It's come with wrong response

graphql-error.png


Please help me to solved out this

  • Linked-in
  • Github
  • Whatsapp
  • Twitter
Replies 4 (4)

Arenas1
Tourist
9 0 1

I have this problem too!!
error.png

chirag_viradiya
Shopify Partner
17 2 4

@Arenas1 I see you have different issue.

as per my expectation. you can reorder the product only n only when you have sort order: manually

So, Please try to first select sort order as manually and execute above query it will work for you

  • Linked-in
  • Github
  • Whatsapp
  • Twitter
Arenas1
Tourist
9 0 1

It's not really a good solution but it's the only thing we can do at the moment. Thanks!!

chirag_viradiya
Shopify Partner
17 2 4

@Arenas1 Actually, If you want to use reorderposition api than at time of create collection you have to set the sortorder: manual and than execute this api that's the rules of shopify. so, I think we must have to applied.

  • Linked-in
  • Github
  • Whatsapp
  • Twitter