Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Cannot read properties of undefined (reading 'includes')

default discord avatar
generator101last year

I am trying to create a graphql to create a user and trying this in the playground:



mutation(
  $email: String!
  $password: String!
  $username: String!
) {
  createUser(
    data: {
      email: $email
      password: $password
      username: $username
    }
  )
  {
    id
    username
    email
  }
}


and pass variables:


{   "email": "email@email.com",   "password": "1234567",   "username": "username" }


but I get this error:



{
  "errors": [
    {
      "message": "Cannot read properties of undefined (reading 'includes')",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "createUser"
      ],
      "extensions": {
        "name": "TypeError"
      }
    }
  ],
  "data": {
    "createUser": null
  }
}


what is causing this error and where can I start debugging?



it was because of a hook mistake

    Star on GitHub

    Star

    Chat on Discord

    Discord

    online

    Can't find what you're looking for?

    Get dedicated engineering support directly from the Payload team.