title: "Field \"createUser\" must not have a selection since type \"[String]\" has no subfields."
body: <p>I am new to this, please be patient with me. I am trying this mutation</p>
  <pre><code>mutation{
    createUser(userInput:{email:&quot;test21m@g.com&quot;, password:&quot;1223&quot;}){
      _id
      email
    }
  }
  </code></pre>
  <p>but I get this error:</p>
  <blockquote>
  <p>&quot;message&quot;: &quot;Field &quot;createUser&quot; must not have a selection since type
  &quot;[String]&quot; has no subfields.&quot;,</p>
  </blockquote>
  <hr />
  <p>file structure is the following
  <em>schema.js</em></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const {buildSchema} = require('graphql')
  
  module.exports = buildSchema(`
          type Booking{
          _id: ID!
          event:Event!
          user: User!
          createdAt: String!
          updatedAt: String!
      }
  
      type Event {
          _id:ID!
          title:String!
          description:String!
          price:Float!
          date:String!
          creator:String!
      }
  
      type User{
          _id: ID!
          email: String!
          password: String
          createdEvents:[Event!]
      }
  
      type AuthData{
          userId: ID!
          token: String!
          tokenExpiration: Int!
      }
  
      input EventInput {
          title:String!
          description:String!
          price:Float!
          date:String!
      }
  
      input UserInput{
          email:String!
          password:String!
      }
  
      type RootQuery {
          events:[Event!]!
          bookings: [Booking!]!
          login(email: String!, password: String!): AuthData!
      }
  
      type RootMutation{
          createEvent(eventInput : EventInput):[String]
          createUser(userInput: UserInput):[String]
          bookEvent(eventId: ID!): Booking!
          cancelBooking(bookingId: ID!): Event!
      }
  
      schema {
          query   :   RootQuery
          mutation:   RootMutation
      }
  `)</code></pre>
  </div>
  </div>
  </p>
  <hr />
  <p><em>auth-resover.js</em></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const bcrypt = require('bcryptjs')
  const User = require('../../models/user')
  const jwt = require('jsonwebtoken')
  
  module.exports = {   
      // Create User Resolver __________________________________________________
  
      createUser: async args =&gt;{
          try{
              const existingUser = await User.findOne({email:args.userInput.email})
              if(existingUser) throw new Error('User exists already.')
  
              const hashedPassword =  await bcrypt.hash(args.userInput.password, 12)
  
              const user = new User({
                  email: args.userInput.email,
                  password: args.userInput.password
              })
  
              const result = await user.save()
  
              return {...result._doc, password:null,  _id: result.id}    
  
          }catch(err) { throw err }
      },  
  // end of User Resolver __________________________________________________
  
  
      //this name has to match the name in "type RootQuery" schema-index.js
      login: async({email, password}) =&gt; {
          const user = await User.findOne({email:email})
          if(!user) throw new Error('Invalid Cridentials: user not found')
  
          const isEqual = await bcrypt.compare(password, user.password)
          if(!isEqual) throw new Error('Invalid Cridentials: password is incorrect')
  
          const token = await jwt.sign(
                                  {userId: user.id, email: user.email},
                                  'superLongerSuperSecretKey',
                                  {expriresIn:'1h'}) 
          return { 
                  userId: user.id, 
                  token: token, 
                  tokenExpiration: 1}
      }
  }</code></pre>
  </div>
  </div>
  </p>