title: Apollo GraphQL "Cannot return null for non-nullable field Mutation.createUser"
body: <p>I know this is a somewhat common issue, but my implementation differs from the other posts. I'm using the most basic implementation which I can't get to work. I'm using Sequelize with MySQL as the database implementation.</p>
  
  <p>resolvers.js</p>
  
  <pre><code>const resolvers = {
      Query: {
          async getStudent (root, { id }, { models }) {
              return models.User.findByPk(id)
          },
      },
      Mutation: {
          async createUser (root, { name, email }, { models }) {
              return models.User.create({
                  name,
                  email
              })
          },
      },
  }
  </code></pre>
  
  <p>schema.js</p>
  
  <pre><code>const { gql } = require('apollo-server-express');
  const typeDefs = gql`
      type User {
          id: Int!
          name: String!
          email: String!
      }
      type Query {
          getUser(id: Int!): User
          getAllUsers: [User!]!
      }
      type Mutation {
          createUser(name: String!, email: String!): User!
      }`
  module.exports = typeDefs;
  </code></pre>
  
  <p>User model</p>
  
  <pre><code>'use strict';
  module.exports = (sequelize, DataTypes) =&gt; {
    const User = sequelize.define('User', {
      name: DataTypes.STRING,
      email: DataTypes.STRING
    }, {});
    User.associate = function(models) {
      // associations can be defined here
    };
    return User;
  };
  </code></pre>
  
  <p>Yet when running the following mutation:</p>
  
  <blockquote>
    <p>mutation{   createUser(name:"Nate", email:"nate@test.com"){
        id   } }</p>
  </blockquote>
  
  <p>I receive:</p>
  
  <blockquote>
    <p>"errors": [
        {
          "message": "Cannot return null for non-nullable field Mutation.createUser.",
          "locations": [
            {
              "line": 2,
              "column": 3
            }
          ],
          "path": [
            "createUser"
          ],</p>
  </blockquote>