title: Graphql mutation error: "Field 'createUser' is missing required arguments: input"
body: <p>I'm trying to follow along this article on how to create a mutation on a rails server using GraphQl <a href="https://www.howtographql.com/graphql-ruby/4-authentication" rel="noreferrer">https://www.howtographql.com/graphql-ruby/4-authentication</a></p>
  
  <p>However, I'm stuck at the CreateUser Mutation step, I get the follow error hash when trying it out in GraphiQL:</p>
  
  <pre><code>{
    "errors": [
      {
        "message": "Field 'createUser' is missing required arguments: input",
        "locations": [
          {
            "line": 45,
            "column": 3
          }
        ],
        "path": [
          "mutation CreateUser",
          "createUser"
        ],
        "extensions": {
          "code": "missingRequiredArguments",
          "className": "Field",
          "name": "createUser",
          "arguments": "input"
        }
      },
      {
        "message": "Field 'createUser' doesn't accept argument 'username'",
        "locations": [
          {
            "line": 46,
            "column": 5
          }
        ],
        "path": [
          "mutation CreateUser",
          "createUser",
          "username"
        ],
        "extensions": {
          "code": "argumentNotAccepted",
          "name": "createUser",
          "typeName": "Field",
          "argumentName": "username"
        }
      },
      {
        "message": "Field 'createUser' doesn't accept argument 'authProvider'",
        "locations": [
          {
            "line": 47,
            "column": 5
          }
        ],
        "path": [
          "mutation CreateUser",
          "createUser",
          "authProvider"
        ],
        "extensions": {
          "code": "argumentNotAccepted",
          "name": "createUser",
          "typeName": "Field",
          "argumentName": "authProvider"
        }
      },
      {
        "message": "Variable $username is declared by CreateUser but not used",
        "locations": [
          {
            "line": 44,
            "column": 1
          }
        ],
        "path": [
          "mutation CreateUser"
        ],
        "extensions": {
          "code": "variableNotUsed",
          "variableName": "username"
        }
      },
      {
        "message": "Variable $email is declared by CreateUser but not used",
        "locations": [
          {
            "line": 44,
            "column": 1
          }
        ],
        "path": [
          "mutation CreateUser"
        ],
        "extensions": {
          "code": "variableNotUsed",
          "variableName": "email"
        }
      },
      {
        "message": "Variable $password is declared by CreateUser but not used",
        "locations": [
          {
            "line": 44,
            "column": 1
          }
        ],
        "path": [
          "mutation CreateUser"
        ],
        "extensions": {
          "code": "variableNotUsed",
          "variableName": "password"
        }
      }
    ]
  }
  </code></pre>
  
  <p>I just followed the code in the article, my files:</p>
  
  <p><strong>create_user.rb</strong></p>
  
  <pre><code>module Mutations
    class CreateUser &lt; BaseMutation
      # often we will need input types for specific mutation
      # in those cases we can define those input types in the mutation class itself
      class AuthProviderSignupData &lt; Types::BaseInputObject
        argument :credentials, Types::AuthProviderCredentialsInput, required: false
      end
  
      argument :username, String, required: true
      argument :auth_provider, AuthProviderSignupData, required: false
  
      type Types::UserType
  
      def resolve(username: nil, auth_provider: nil)
        User.create!(
          username: username,
          email: auth_provider&amp;.[](:credentials)&amp;.[](:email),
          password: auth_provider&amp;.[](:credentials)&amp;.[](:password)
        )
      end
    end
  end
  </code></pre>
  
  <p><strong>user_type.rb</strong></p>
  
  <pre><code>module Types
    class UserType &lt; BaseObject
      field :id, ID, null: false
      field :email, String, null: false
      field :username, String, null: false
      field :photo, String, null: true
      field :phone, String, null: false
      field :island, IslandType, null: false, method: :island
      field :archipel, ArchipelType, null: false, method: :archipel
  
      field :created_at, String, null: false
      field :updated_at, String, null: false
    end
  end
  </code></pre>
  
  <p>I have no clue where this 'input' thing is coming from.</p>