{"record":{"id":"e480b589bd63a309","repo":"instructure/canvas-lms","slug":"a-maximum-of-50-assessees-can-be-provided-at-once","errorCode":null,"errorMessage":"A maximum of 50 assessees can be provided at once","messagePattern":"A maximum of 50 assessees can be provided at once","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/allocation_rule_base.rb","lineNumber":110,"sourceCode":"        if assessor_ids.length > 1\n          raise GraphQL::ExecutionError, I18n.t(\"Only one assessor is allowed when rule applies to assessor\")\n        end\n      elsif assessee_ids.length > 1\n        raise GraphQL::ExecutionError, I18n.t(\"Only one assessee is allowed when rule applies to assessee\")\n      end\n\n      if assessor_ids.empty?\n        raise GraphQL::ExecutionError, I18n.t(\"At least one assessor is required\")\n      end\n      if assessee_ids.empty?\n        raise GraphQL::ExecutionError, I18n.t(\"At least one assessee is required\")\n      end\n\n      if assessor_ids.length > 50\n        raise GraphQL::ExecutionError, I18n.t(\"A maximum of 50 assessors can be provided at once\")\n      end\n      if assessee_ids.length > 50\n        raise GraphQL::ExecutionError, I18n.t(\"A maximum of 50 assessees can be provided at once\")\n      end\n    end\n\n    def get_assignment(assignment_id)\n      Assignment.active.find(assignment_id)\n    rescue ActiveRecord::RecordNotFound\n      raise GraphQL::ExecutionError, I18n.t(\"Assignment not found\")\n    end\n\n    def process_allocation_rules(allocation_rules)\n      if allocation_rules.all?(&:valid?)\n        allocation_rules.each(&:save!)\n        { allocation_rules: }\n      else\n        invalid_rules = allocation_rules.reject(&:valid?)\n        all_allocation_errors = []\n\n        invalid_rules.each do |invalid_rule|","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/allocation_rule_base.rb#L92-L128","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Split the assessee list into batches of at most 50 per mutation call.","Cap the UI selection at 50 or paginate the student picker.","Narrow the list (per-section or per-group submissions) to stay under the cap.","Generate multiple sequential requests in the integration script."],"exampleFix":"// before\nmutation(input: { assessorIds: [\"11\"], assesseeIds: /* 80 ids */ })\n// after: chunk client-side\nassesseeIds.each_slice(50) { |batch| submit({ assessorIds: [\"11\"], assesseeIds: batch }) }","handlingStrategy":"validation","validationCode":"if (input.assesseeIds.length > 50) {\n  throw new Error(`Max 50 assessees per call, got ${input.assesseeIds.length}`);\n}\n// or auto-chunk:\nconst batches = chunk(input.assesseeIds, 50);","typeGuard":null,"tryCatchPattern":"try {\n  await createAllocationRules(input);\n} catch (e) {\n  if (e.message.includes('maximum of 50 assessees')) {\n    // retry with chunked batches of 50\n  }\n}","preventionTips":["Always chunk assessee lists with each_slice(50)","Cap the student multi-select at 50 items with a counter","Submit per-section/per-group instead of whole courses","Document the 50-item API limit in integration code"],"tags":["graphql","validation","limit","canvas"],"backgroundTag":"value-out-of-range","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}