title: Cannot read property 'kind' of undefined at isDocumentNode while export makeExecutableSchema using Apollo Graphql on express js
body: <p>I have created modular of schema like this: User.js</p>
  
  <pre><code>const gqTools = require('graphql-tools');
  
  const user = `
    type User {
      emailId: String
      name: String
      type: Int
      created_on: String
    }
  `;
  
  module.exports = user
  </code></pre>
  
  <p>and this is the UserPayload that has related by the user type schema</p>
  
  <pre><code>const gqTools = require('graphql-tools');
  const User = require('./User')
  
  const userPayload = `
    enum ErrorCodes {
      UNAUTHORIZED
      INTERNAL_ERROR
    }
    type Error {
      code: ErrorCodes
      msg: String
    }
    type UserPayload {
      user: [User]
      error: Error
    }
  `;
  
  module.exports = () =&gt; [userPayload, User]
  </code></pre>
  
  <p>this is the Type Query of user that i created </p>
  
  <pre><code>const gqTools = require('graphql-tools');
  const UserPayload = require('../UserPayload')
  
  const query = `
    type Query {
      checkAuthorized: [UserPayload]
  
    }
  `;
  
  module.exports = () =&gt; [query, UserPayload]
  </code></pre>
  
  <p>this is the resolver i created </p>
  
  <pre><code>const checkAuthorizedResolver = {
    async checkAuthorized(root, data, context) {
      if (context.user.length === 0) {
          return {
              user: null,
              error: {
                  code: 'UNAUTHORIZED',
                  msg: 'UNAUTHORIZED'
              }
          }
      }
  
      let s = `
          select email, name, usertype_id, created_at
          from users
          where id = ${context.user[0].id}
      `
  
      try {
          let result = await context.db.run(s)
          return {
              user: {
                  emailId: result[0].email,
                  name: result[0].name,
                  type: result[0].usertype_id,
                  created_on: result[0].created_at
              },
              error: null
          }
      } catch (err) {
          console.log(err)
          return {
              user: null,
              error: {
                  code: 'UNAUTHORIZED',
                  msg: 'UNAUTHORIZED'
              }
          }
      }
    }
  }
  
  module.exports = checkAuthorizedResolver
  </code></pre>
  
  <p>after it i create the main.js on schema folder that will be import on server.js </p>
  
  <pre><code>const gqTools = require('graphql-tools');
  const jwt = require('jsonwebtoken')
  const { makeExecutableSchema } = require('graphql-tools')
  const moment = require('moment')
  
  const {
    checkAuthorized,
  } = require('../schema/type_Query/type_Query')
  
  const checkAuthorizedResolver = require ('../Controller/checkAuthorized')
  
  module.exports = makeExecutableSchema({
    typeDefs: [checkAuthorized],
    resolvers:{
        checkAuthorizedResolver
    }
  })
  </code></pre>
  
  <p>after i run the program it show the error msg, i dont understand what is mean of "kind" on the error msg because i never declare variable "kind", and i know it is from node module library. may everyone help me what is mean of that error and how to write the syntax on "makeExecutableSchema", because i have follow the documentation from GrahQL Tools for modularization</p>
  
  <p>this is the error msg: </p>
  
  <pre><code>&gt; TypeError: Cannot read property 'kind' of undefined
  &gt;     at isDocumentNode (/home/hari/Documents/kerjaan/nest8gg/kpi/node_modules/graphql-tools/src/schemaGener
  &gt; ator.ts:134:42)
  &gt;     at /home/hari/Documents/kerjaan/nest8gg/kpi/node_modules/graphql-tools/src/schemaGenerator.ts:151:9
  &gt;     at Array.forEach (&lt;anonymous&gt;)
  &gt;     at concatenateTypeDefs (/home/hari/Documents/kerjaan/nest8gg/kpi/node_modules/graphql-tools/src/schema
  &gt; Generator.ts:150:22)
  &gt;     at buildSchemaFromTypeDefinitions (/home/hari/Documents/kerjaan/nest8gg/kpi/node_modules/graphql-tools
  &gt; /src/schemaGenerator.ts:190:21)
  &gt;     at _generateSchema (/home/hari/Documents/kerjaan/nest8gg/kpi/node_modules/graphql-tools/src/schemaGene
  &gt; rator.ts:80:18)
  &gt;     at makeExecutableSchema (/home/hari/Documents/kerjaan/nest8gg/kpi/node_modules/graphql-tools/src/schem
  &gt; aGenerator.ts:109:20)
  &gt;     at Object.&lt;anonymous&gt; (/home/hari/Documents/kerjaan/nest8gg/kpi/server/schema/main.js:41:18)
  &gt;     at Module._compile (module.js:643:30)
  &gt;     at Module._compile (/home/hari/Documents/kerjaan/nest8gg/kpi/node_modules/source-map-support/source-ma
  &gt; p-support.js:492:25)
  </code></pre>