Graphql mutation not working in V4

Graphql mutation is not working for me.

Here is my code:

mutation updateTodo {
  updateTodo(input: { where: { id: "1" }, data: { done: true } }) {
    todo {
      id
      done
    }
  }
}

and I always get this error message:

"message": "Unknown argument \"input\" on field \"Mutation.updateTodo\".",

You are using the Strapi v3 GraphQL format. In stead something like:

mutation {
  updateTodo(id: "1", data: { done: true }) {
    data {
      id
      attributes {
        done
      }
    }
  }
}
1 Like

im having the same problem but im using the correct format.

mutation newClient(
  $name:String!
){
  createCliente( data:{
    name:$name
  }){
    data{
      attributes{
        name
      }
    }
  }
}

It works locally but when is deploys i get this error:

message": "Unknown argument \"data\" on field \"Mutation.createCliente\".",