title: Graphql Query Returning a null value (Apollo Server)
body: <p>I created a mock programmatically for testing at my query but it only returns a null value what am i doing wrong. I am using the casual library for generating values for my mock</p>
  
  <p>Here are my files:</p>
  
  <p>index.js</p>
  
  <pre><code>   import express from 'express'
  import bodyParser from 'body-parser'
  import { graphqlExpress,graphiqlExpress } from 'graphql-server-express'
  import { makeExecutableSchema } from 'graphql-tools'
  import mock from './mock'
  import schema from './schema'
  const app = express()
  const executableSchema = makeExecutableSchema({
      typeDefs: schema,
      mock
  })
  
  app.post(
      '/graphql',
      bodyParser.json(),
      graphqlExpress(() =&gt; ({
          schema: executableSchema
      }))
  )
  
  app.use('/graphiql',graphiqlExpress({
      endpointURL: '/graphql',
  }))
  app.listen(8080)
  console.log("listening at 8080")
  </code></pre>
  
  <p>schema.js</p>
  
  <pre><code>const schema = `
  interface Novel {
      artist: String
      author: String
      chapters: [Chapter]
      description: String
      genre: [String]
      id: String
      image: String
      language: String
      modified: String!
      name: String!
      status: String
      tags: [String]
      type: String
      year: String
  }
  
  interface Chapter {
  chapter: String!
  volume: String!
  content: String!
  }
  
  type NovelCrawler implements Novel{
      artist: String
      author: String
      chapters: [Chapter]
      description: String
      genre: [String]
      id: String
      image: String
      language: String
      modified: String!
      name: String!
      novelurl: String
      status: String
      tags: [String]
      type: String
      year: String
  }
  
  type ChapterCrawler implements Chapter {
      chapter: String!
      chapterurl: String
      content: String!
      novelurl: String
      volume: String!
  }
  `
  const Query = `
  type Query {
       novels: [Novel]
  }
  `
  export default [schema, Query]
  </code></pre>
  
  <p>mock.js</p>
  
  <pre><code>import casual from 'casual'
  const genre = ['romance', 'comedy', 'action']
  const Novel = () =&gt; ({
      artist: casual.name,
      author: casual.name,
      description: casual.sentences(3),
      genre: [casual.random_element(genre), casual.random_element(genre)],
      id: casual.url,
      image: 'sdfgrtw3wedfgb2345y675trfdvfbghdsfdssfd',
      language: casual.random_element(['chinese', 'japanese', 'korean']),
      modified: casual.date('YYYY-MM-DD'),
      name: casual.word,
      status: casual.random_element(['Completed', 'Ongoing']),
      tags: [],
      novelurl: casual.url,
      type: casual.random_element(['Web Novel', 'Light Novel']),
      year: casual.year
  })
  
  const Chapter = () =&gt; ({
      chapter: casual.integer(1, 50),
      chapterurl: casual.url,
      content: casual.sentences(10),
      novelurl: casual.url,
      volume: casual.integer(1, 5)
  })
  
  const arrNovel = []
  const arrChapter = []
  for (let x = 0; x &lt; 20; ++x) {
      arrNovel.push(Novel())
      arrChapter.push(Chapter())
  }
  
  const mock = {
      // Query: { novels: () =&gt; ({}) },
      Novel: {
          __resolveType(obj, context, info) {
              return 'NovelCrawler'
          }
      },
      Chapter: {
          __resolveType(obj, context, info) {
              return 'ChapterCrawler'
          }
      },
      NovelCrawler: () =&gt; arrNovel,
      ChapterCrawler: () =&gt; arrChapter
  }
  
  export default mock
  </code></pre>
  
  <p>When i run the following query:</p>
  
  <pre><code>{
    novels{
      description
    }
  }
  </code></pre>
  
  <p>it returns:</p>
  
  <pre><code>{
    "data": {
      "novels": null
    }
  }
  </code></pre>
  
  <p>so i tried:</p>
  
  <pre><code>{
   novels{
   ... on NovelCrawler{
    artist
      }
    }
   }
  </code></pre>
  
  <p>this returns</p>
  
  <pre><code> {
    "errors": [
      {
        "message": "Unknown operation named \"null\"."
      }
    ]
  }
  </code></pre>
  
  <p>what am i doing wrong</p>