Receiving missingRequiredInputObjectAttribute

Example Error

{
  "errors": [
    {
      "message": "Argument 'card_id' on InputObject 'CreateInboxEmailInput' is required. Expected type ID!",
      "locations": [
        {
          "line": 21,
          "column": 12
        }
      ],
      "path": [
        "mutation",
        "createInboxEmail",
        "input",
        "card_id"
      ],
      "extensions": {
        "code": "missingRequiredInputObjectAttribute",
        "argumentName": "card_id",
        "argumentType": "ID!",
        "inputObjectType": "CreateInboxEmailInput"
      }
    }
  ]
}

Why This Happens

This error occurs when an argument is missing or invalid in the current operation, in this case card_id as we can notice on the error message. Some common causes are:

  • Missing Argument
    • The argument was omitted entirely from the mutation input (e.g., "card_id").
  • Typographical Error
    • Misspelling the argument name (e.g., cardid instead of card_id).
  • Invalid ID Format
    • Providing a non-numeric or non-existent card ID.

Hot to Fix It

  1. Include the argument
    1. Add the argument to the mutation input (e.g., add the card_id)
  2. Verify Spelling
    1. Ensure the argument is spelled exactly as it’s listed in the playground API documentation (case-sensitive).
  3. Use a Valid Card ID
    1. Confirm that the ID corresponds to an existing entity, such as a Card, Pipe, or Phase. Double-check that the entity hasn’t been deleted and that you have the necessary permissions to access it.

Example Corrected Mutation

The error in the original query occurred because the "card_id" argument was missing. We can fix it by adding the argument with a valid id:

mutation {
  createInboxEmail(
    input: {
      repo_id: 123456789,
      card_id: 987654321,    # Valid Card ID
      from: "[email protected]",
      to: "[email protected]",
      subject: "Action Required",
      text: "Please review the attached document."
    }
  ) {
    inbox_email {
      id
    }
  }
}