{"record":{"id":"2b3da09c6256795a","repo":"instructure/canvas-lms","slug":"a-maximum-of-50-assessors-can-be-provided-at-once","errorCode":null,"errorMessage":"A maximum of 50 assessors can be provided at once","messagePattern":"A maximum of 50 assessors can be provided at once","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/allocation_rule_base.rb","lineNumber":107,"sourceCode":"          raise GraphQL::ExecutionError, I18n.t(\"Only one assessee is allowed when creating reciprocal rules\")\n        end\n      elsif applies_to_assessor\n        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?)","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/allocation_rule_base.rb#L89-L125","documentation":"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.","triggerScenarios":"Calling an allocation-rule create mutation with assessorIds.length > 50, e.g. bulk-assigning an entire large course section in one request.","commonSituations":"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.","solutions":["Chunk the input into batches of at most 50 assessors per mutation call.","Limit the UI multi-select to 50 or paginate the picker.","Filter the assessor list (e.g. only unassigned students) to shrink it below the cap.","Increase request count with sequential/parallel calls if many rules are needed."],"exampleFix":"// before\nmutation(input: { assessorIds: /* 120 ids */, assesseeIds: [...] })\n// after: chunk client-side\nids.each_slice(50) { |batch| submit({ assessorIds: batch, assesseeIds: [...] }) }","handlingStrategy":"validation","validationCode":"if (input.assessorIds.length > 50) {\n  throw new Error(`Max 50 assessors per call, got ${input.assessorIds.length}`);\n}\n// or auto-chunk:\nconst batches = chunk(input.assessorIds, 50);","typeGuard":null,"tryCatchPattern":"try {\n  await createAllocationRules(input);\n} catch (e) {\n  if (e.message.includes('maximum of 50 assessors')) {\n    // retry with chunked batches of 50\n  }\n}","preventionTips":["Always chunk assessor lists with each_slice(50)","Add a selection counter with a 50-item cap in the UI","Filter to eligible assessors to shrink payloads","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"}