title: Error: "user" defined in resolvers, but not in schema
body: <p>I'm trying to set up my schema for Apollo Server, and I'm running into an error.</p>
  
  <p>What I'm trying is actually an attempt to fix a common and even more unhelpful message, using advice found here:</p>
  
  <p><a href="https://github.com/apollographql/apollo-server/issues/1998" rel="noreferrer">https://github.com/apollographql/apollo-server/issues/1998</a></p>
  
  <p>I'm not really sure how to reduce the code here, since I haven't been able to isolate the error more than this.</p>
  
  <p>schema.js</p>
  
  <pre><code>import { makeExecutableSchema } from 'apollo-server-express'
  import ApplicationSchema from './types'
  import Resolvers from './resolvers'
  
  export default makeExecutableSchema({
    typeDefs: ApplicationSchema,
    resolvers: Resolvers
  })
  </code></pre>
  
  <p>resolvers/index.js</p>
  
  <pre><code>import user from './user'
  
  export default {
    user
  }
  </code></pre>
  
  <p>resolvers/user.js</p>
  
  <pre><code>import Joi from 'joi'
  import mongoose from 'mongoose'
  import { UserInputError } from 'apollo-server-express'
  import { signUp, signIn } from '../validators'
  import { User } from '../schemata' // mongoose schema
  import * as Authentication from '../authentication'
  
  export default {
    Query: {
      me: (root, args, { request }, info) =&gt; {
        Authentication.checkSignedIn(request)
  
        return User.findbyId(request.session.userId)
      },
  
      users: (root, args, { request }, info) =&gt; {
        Authentication.checkSignedIn(request)
        User.find({})
      },
  
      user: (root, args, { request }, info) =&gt; {
        const { id } = args
  
        Authentication.checkSignedIn(request)
  
        if (!mongoose.Types.ObjectId.isValid(id)) {
          throw new UserInputError(`${id} is not a valid user ID.`)
        }
  
        return User.findById(id)
      }
    },
  
    Mutation: {
      signup: async (root, args, { request }, info) =&gt; {
        Authentication.checkSignedOut(request)
        await Joi.validate(args, signUp, { abortEarly: false })
        return User.create(args)
      },
  
      signIn: async (root, args, { request }, info) =&gt; {
        const { userId } = request.session
  
        if (userId) return User.findById(userId)
  
        await Joi.validate(args, signIn, { abortEarly: false })
  
        const user = await Authentication.attemptSignIn(args)
  
        request.session.userId = user.id
  
        return user
      },
  
      signOut: async (root, args, { request, response }, info) =&gt; {
        Authentication.checkSignedIn(request)
  
        return Authentication.signOut(request, response)
      }
    }
  }
  </code></pre>
  
  <p>types/index.js</p>
  
  <pre><code>import root from './root'
  import user from './user'
  
  export default [
    root, 
    user
  ]
  </code></pre>
  
  <p>types/root,js</p>
  
  <pre><code>import { gql } from 'apollo-server-express'
  
  export default gql`
   type Query {
     _: String
   }
  
   type Mutation {
     _: String
   }
  
   type Subscription {
     _: String
   }
  </code></pre>
  
  <p>types/user.js</p>
  
  <pre><code>import { gql } from 'apollo-server-express'
  
  export default gql`
    type User {
      id: ID!
      email: String!
      username: String!
      name: String!
      password: String!
      createdAt: String!
    }
  
    extend type Query {
      me: User
      user(id: ID!): User
      users: [User!]!
    }
  
    extend type Mutation {
      signUp(email: String!, username: String!, name: String!): User
      signIn(email: String!, password: String!): User
      signOut: Boolean
    }
  </code></pre>
  
  <p>Hopefully, schema.js should run without errors and the resulting executable schema will work well with Apollo Server.</p>