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

A maximum of 50 assessees can be provided at once

Error message

A maximum of 50 assessees can be provided at once

What it means

Raised by validate_id_arrays! in AllocationRuleBase when assessee_ids contains more than 50 entries. Assessee bulk input is capped at 50 per mutation call and larger payloads are rejected with a GraphQL ExecutionError.

Solutions

  1. Split the assessee list into batches of at most 50 per mutation call.
  2. Cap the UI selection at 50 or paginate the student picker.
  3. Narrow the list (per-section or per-group submissions) to stay under the cap.
  4. Generate multiple sequential requests in the integration script.

Example fix

// before
mutation(input: { assessorIds: ["11"], assesseeIds: /* 80 ids */ })
// after: chunk client-side
assesseeIds.each_slice(50) { |batch| submit({ assessorIds: ["11"], assesseeIds: batch }) }
Defensive patterns

Strategy: validation

Validate before calling

if (input.assesseeIds.length > 50) {
  throw new Error(`Max 50 assessees per call, got ${input.assesseeIds.length}`);
}
// or auto-chunk:
const batches = chunk(input.assesseeIds, 50);

Try / catch

try {
  await createAllocationRules(input);
} catch (e) {
  if (e.message.includes('maximum of 50 assessees')) {
    // retry with chunked batches of 50
  }
}

Prevention

When it happens

Trigger: Calling an allocation-rule create mutation with assesseeIds.length > 50, e.g. selecting an entire large section of students to be assessed in one request.

Common situations: Bulk assessment tooling submits every student in a large course at once; a data import maps a big roster into a single mutation; the UI multi-select allows unlimited selection with no counter.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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

Appendix: source

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

        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?)
        allocation_rules.each(&:save!)
        { allocation_rules: }
      else
        invalid_rules = allocation_rules.reject(&:valid?)
        all_allocation_errors = []

        invalid_rules.each do |invalid_rule|

View on GitHub (pinned to 1c9f0bb801)