instructure/canvas-lms · error · GraphQL::ExecutionError

At least one assessee is required

Error message

At least one assessee is required

What it means

Raised by validate_id_arrays! in AllocationRuleBase when the assessee_ids array is empty. Every allocation rule requires at least one assessee (the student being assessed), so an empty list is rejected with a GraphQL ExecutionError.

Solutions

  1. Provide at least one assessee ID in the mutation input.
  2. Validate the array client-side before submit and disable submit when empty.
  3. Verify the section/roster query feeding the ID list returns students.
  4. Confirm the assignment has eligible assessable students.

Example fix

// before
{ assessorIds: ["11"], assesseeIds: [] }
// after
{ assessorIds: ["11"], assesseeIds: ["21"] }
Defensive patterns

Strategy: validation

Validate before calling

if (!Array.isArray(input.assesseeIds) || input.assesseeIds.length === 0) {
  throw new Error('Select at least one assessee before submitting');
}

Type guard

function hasAssessees(input) {
  return Array.isArray(input.assesseeIds) && input.assesseeIds.length > 0;
}

Try / catch

try {
  await createAllocationRules(input);
} catch (e) {
  if (e.message.includes('At least one assessee is required')) {
    // prompt user to pick assessees
  }
}

Prevention

When it happens

Trigger: Calling an allocation-rule create mutation with assesseeIds: [] (or omitted/null) even when assessorIds is valid.

Common situations: A student filter returns no one to be assessed and the empty form is submitted; an automation derives assessee IDs from an empty roster/section; UI state lost multi-select values before submit.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/53610d789ecae4f1. Report an issue: GitHub.

Appendix: source

Thrown at app/graphql/mutations/allocation_rule_base.rb:103

        if assessor_ids.length > 1
          raise GraphQL::ExecutionError, I18n.t("Only one assessor is allowed when creating reciprocal rules")
        end
        if assessee_ids.length > 1
          raise GraphQL::ExecutionError, I18n.t("Only one assessee is allowed when creating reciprocal rules")
        end
      elsif applies_to_assessor
        if assessor_ids.length > 1
          raise GraphQL::ExecutionError, I18n.t("Only one assessor is allowed when rule applies to assessor")
        end
      elsif assessee_ids.length > 1
        raise GraphQL::ExecutionError, I18n.t("Only one assessee is allowed when rule applies to assessee")
      end

      if assessor_ids.empty?
        raise GraphQL::ExecutionError, I18n.t("At least one assessor is required")
      end
      if assessee_ids.empty?
        raise GraphQL::ExecutionError, I18n.t("At least one assessee is required")
      end

      if assessor_ids.length > 50
        raise GraphQL::ExecutionError, I18n.t("A maximum of 50 assessors can be provided at once")
      end
      if assessee_ids.length > 50
        raise GraphQL::ExecutionError, I18n.t("A maximum of 50 assessees can be provided at once")
      end
    end

    def get_assignment(assignment_id)
      Assignment.active.find(assignment_id)
    rescue ActiveRecord::RecordNotFound
      raise GraphQL::ExecutionError, I18n.t("Assignment not found")
    end

    def process_allocation_rules(allocation_rules)
      if allocation_rules.all?(&:valid?)

View on GitHub (pinned to 1c9f0bb801)