title: "Type RootQueryType must define one or more fields." }
body: <p>Trying to get GraphQL to work with JavaScript.  Not sure where my mistake is.</p>
  
  <p>My code</p>
  
  <pre><code>const graphql = require('graphql');
  const _ = require('lodash');
  const {
    GraphQLObjectType,
    GraphQLString,
    GraphQLInt,
    GraphQLSchema
  } = graphql;
  const users = [
    { id: "23", firstName: "Bill", age: 20},
    { id: "47", firstName: "Sam", age: 21}
  ];
  const UserType = new GraphQLObjectType({
    name: 'User',
    fields: {
      id: {type: GraphQLString},
      firstName: {type: GraphQLString},
      age:{type: GraphQLInt}
    }
  });
  const RootQuery = new GraphQLObjectType({
    name: 'RootQueryType',
    fields: {
      user: {
        type: UserType,
        args: { id: { type: GraphQLString } },
        resolve(parentValue, args) {
           return _.find(users, { id: args.id });
        }
      }
    }
  });
  module.exports = new GraphQLSchema ({
    query: RootQuery
  });
  </code></pre>
  
  <p>I am getting </p>
  
  <blockquote>
    <p>{   "errors": [
        {
          "message": "Type RootQueryType must define one or more fields."
        } 
      ]  }</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/4zFMV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4zFMV.png" alt="enter image description here"></a></p>
  
  <p>Why is it not working?</p>