Value provided is incompatible with expected type

Tried to use slash today, got this error for reasons I could not understand.

Could somebody point out what I’m doing wrong., thanks in advance.

The Schema

"""
This is a User of the Application
"""
type User {
    id: ID!
    name: String!
}

The Mutation

mutation {
  addUser(input: {
    name: "Preet"
  }) {
    user {
      id
      name
    }
  }
}

The error

{
  "errors": [
    {
      "message": "Value provided {name:\"Preet\"} is incompatible with expected type [AddUserInput!]!",
      "locations": [
        {
          "line": 2,
          "column": 18
        }
      ]
    }
  ]
}

@preetjdp your input to the mutation should be an array ([AddUserInput!]!), for example - [{name: “Preet”}] . You can see the definitions from the docs tab.

1 Like

Ah Dumb me

Got it