{"record":{"id":"53610d789ecae4f1","repo":"instructure/canvas-lms","slug":"at-least-one-assessee-is-required","errorCode":null,"errorMessage":"At least one assessee is required","messagePattern":"At least one assessee is required","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/allocation_rule_base.rb","lineNumber":103,"sourceCode":"        if assessor_ids.length > 1\n          raise GraphQL::ExecutionError, I18n.t(\"Only one assessor is allowed when creating reciprocal rules\")\n        end\n        if assessee_ids.length > 1\n          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?)","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/allocation_rule_base.rb#L85-L121","documentation":"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.","triggerScenarios":"Calling an allocation-rule create mutation with assesseeIds: [] (or omitted/null) even when assessorIds is valid.","commonSituations":"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.","solutions":["Provide at least one assessee ID in the mutation input.","Validate the array client-side before submit and disable submit when empty.","Verify the section/roster query feeding the ID list returns students.","Confirm the assignment has eligible assessable students."],"exampleFix":"// before\n{ assessorIds: [\"11\"], assesseeIds: [] }\n// after\n{ assessorIds: [\"11\"], assesseeIds: [\"21\"] }","handlingStrategy":"validation","validationCode":"if (!Array.isArray(input.assesseeIds) || input.assesseeIds.length === 0) {\n  throw new Error('Select at least one assessee before submitting');\n}","typeGuard":"function hasAssessees(input) {\n  return Array.isArray(input.assesseeIds) && input.assesseeIds.length > 0;\n}","tryCatchPattern":"try {\n  await createAllocationRules(input);\n} catch (e) {\n  if (e.message.includes('At least one assessee is required')) {\n    // prompt user to pick assessees\n  }\n}","preventionTips":["Disable submit until at least one assessee is chosen","Verify roster/section queries return students before building input","Preserve multi-select state across form interactions","Handle empty-section cases explicitly in the UI"],"tags":["graphql","validation","empty-array","canvas"],"backgroundTag":"empty-required-field","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"}