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

A maximum of 50 assessors can be provided at once

Error message

A maximum of 50 assessors can be provided at once

What it means

Raised by validate_id_arrays! in AllocationRuleBase when assessor_ids contains more than 50 entries. The mutation caps bulk assessor input at 50 per call to protect performance, rejecting larger payloads with a GraphQL ExecutionError.

Solutions

  1. Chunk the input into batches of at most 50 assessors per mutation call.
  2. Limit the UI multi-select to 50 or paginate the picker.
  3. Filter the assessor list (e.g. only unassigned students) to shrink it below the cap.
  4. Increase request count with sequential/parallel calls if many rules are needed.

Example fix

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

Strategy: validation

Validate before calling

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

Try / catch

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

Prevention

When it happens

Trigger: Calling an allocation-rule create mutation with assessorIds.length > 50, e.g. bulk-assigning an entire large course section in one request.

Common situations: Large enrollment courses/sections exceed the cap in bulk tooling; a sync job submits all eligible assessors at once; a UI multi-select has no upper limit and the user selects everyone.

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/2b3da09c6256795a. Report an issue: GitHub.

Appendix: source

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

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

View on GitHub (pinned to 1c9f0bb801)