GraphQL mutation variables

You probably defined the input name as a non-null string (something like type: new GraphQLNonNull(GraphQLString) if using js server, or String! in plain GraphQL).

So your input in the mutation must match, which means it must also be a non-null string. If you change to the following, it should work:

mutation M($name: String!) {
  addGroup(name:$name) {
    id,
    name
  }
}

Also if you define a default value as you did, it will be a non-null string.

Finally, you could drop the requirement of being a non-null in the server.