title: GraphQL with Keystone wants field type must be Output Type but got: undefined
body: <p>I wan't to make GraphQL endpoint for my keystone.js app (via express middleware express-graphql).</p>
  
  <p>Here is my Keystone Schema:</p>
  
  <pre><code>const keystone = require('keystone');
  
  const Types = keystone.Field.Types;
  
  const User = new keystone.List('User');
  
  const localStorage = new keystone.Storage({
    adapter: keystone.Storage.Adapters.FS,
    fs: {
      path: './src/upload/avatars',
      publicPath: '/upload/avatars',
    },
  });
  
  User.add({
    name: { type: Types.Name, required: true, index: true },
    email: { type: Types.Email, initial: true, index: true },
    password: { type: Types.Password, initial: true, required: true },
  }, 'Profile', {
    photo: { type: Types.File, storage: localStorage },
  }, 'Permissions', {
    isAdmin: { type: Boolean, label: 'Can access Keystone', index: true },
  },
  );
  
  // Provide access to Keystone
  User.schema.virtual('canAccessKeystone').get(function () {
    return this.isAdmin;
  });
  
  User.defaultColumns = 'name, email, isAdmin';
  User.register();
  </code></pre>
  
  <p>The key problem with field Photo which implemented as File type in keystone.js.</p>
  
  <p>Below my GraphQL Schema:</p>
  
  <pre><code>import {   GraphQLSchema,   GraphQLID,   GraphQLList,   GraphQLNonNull,   GraphQLObjectType, } from 'graphql';
  
  const keystoneTypes = require('keystone-graphql').Types; const keystone = require('keystone');
  
  const User = keystone.list('User');
  
  const userType = new GraphQLObjectType({   name: 'User',   fields: ()
  =&gt; ({
      id: { type: new GraphQLNonNull(GraphQLID) },
      name: { type: new GraphQLNonNull(keystoneTypes.Name(User.fields.name)) },
      email: keystoneTypes.Email(User.fields.email),
      photo: keystoneTypes.File(User.fields.photo),   }), });
  
  const queryRootType = new GraphQLObjectType({   name: 'Query',   fields: {
      users: {
        type: new GraphQLList(userType),
        resolve: () =&gt;
          User.model.find().exec(),
      },
      user: {
        type: userType,
        args: {
          id: {
            description: 'id of the user',
            type: new GraphQLNonNull(GraphQLID),
          },
        },
        resolve: (_, args) =&gt; User.model.findById(args.id).exec(),
      },   }, });
  
  export default new GraphQLSchema({   query: queryRootType, });
  </code></pre>
  
  <p>And the Field File implementation, which included in forked keystone-graphql package:</p>
  
  <pre><code>'use strict';
  
  const GraphQL = require('graphql');
  
  const KeystoneFileType = new GraphQL.GraphQLObjectType({
      name: 'KeystoneFile',
      fields: {
      size: { type: GraphQL.GraphQLInt },
      mimetype: { type: GraphQL.GraphQLString },
      filename: { type: GraphQL.GraphQLString },
    },
  });
  
  module.exports = (field) =&gt; KeystoneFileType;
  </code></pre>
  
  <p>I want to make pull request to keystone-graphql package with File field when it will works properly. At this moment I have error from GraphQL:</p>
  
  <pre><code>Error: User.photo field type must be Output Type but got: undefined.
      at invariant (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/jsutils/invariant.js:19:11)
      at /Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/definition.js:335:5
      at Array.forEach (native)
      at defineFieldMap (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/definition.js:326:14)
      at GraphQLObjectType.getFields (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/definition.js:284:44)
      at typeMapReducer (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/schema.js:206:25)
      at typeMapReducer (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/schema.js:187:12)
      at /Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/schema.js:216:20
      at Array.forEach (native)
      at typeMapReducer (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/schema.js:207:27)
      at Array.reduce (native)
      at new GraphQLSchema (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/node_modules/graphql/type/schema.js:95:34)
      at Object.&lt;anonymous&gt; (/Users/Vadim/Dropbox/WebStormProjects/mulibwanji/graphql/Schema.js:58:16)
  </code></pre>