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

Assignment overrides are not allowed in the parent…

Error message

Assignment overrides are not allowed in the parent assignment for checkpoints.

What it means

When creating/updating a parent assignment with `for_checkpoints: true` (discussion checkpoints), providing `assignment_overrides` is invalid; AssignmentBase.prepare_overrides! raises instead of applying them. Checkpoint sub-assignments carry their own overrides, so overrides on the parent are disallowed.

Solutions

  1. Remove assignmentOverrides from the input when forCheckpoints is true.
  2. Apply overrides to the checkpoint sub-assignments after the parent is created instead.
  3. Only include forCheckpoints: true if you actually intend checkpoint behavior.
  4. Branch client code: build separate payloads for checkpoint vs regular assignments.

Example fix

// before
updateAssignment(input: { id, forCheckpoints: true, assignmentOverrides: [...] })

// after
updateAssignment(input: { id, forCheckpoints: true }) // no overrides on parent
// set overrides on each checkpoint assignment separately
Defensive patterns

Strategy: validation

Validate before calling

if input.forCheckpoints && input.assignmentOverrides?.length
  throw new Error('Remove assignmentOverrides for checkpoint parents')

Try / catch

try {
  await updateAssignment(input)
} catch (e) {
  if (e.message.includes('overrides are not allowed')) stripOverridesAndRetry()
}

Prevention

When it happens

Trigger: A createAssignment/updateAssignment mutation that includes both `forCheckpoints: true` and a non-empty `assignmentOverrides` array.

Common situations: Migrating existing assignment code to the checkpoints model and reusing the same input payload; UI sending default override sets unconditionally; clients copying payloads from non-checkpoint assignment calls.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/assignment_base.rb:211

      input_hash[:assignment_group_id] = GraphQLHelpers.parse_relay_or_legacy_id(input_hash[:assignment_group_id], "AssignmentGroup")
    end
    if input_hash.key? :group_set_id
      input_hash[:group_category_id] = GraphQLHelpers.parse_relay_or_legacy_id(input_hash.delete(:group_set_id), "GroupSet")
    end

    input_hash
  end

  def prepare_module_ids!(input_hash)
    if input_hash.key? :module_ids
      input_hash.delete(:module_ids).map { |id| GraphQLHelpers.parse_relay_or_legacy_id(id, "Module") }.map(&:to_i)
    end
  end

  def prepare_overrides!(input_hash, api_proxy)
    if input_hash.key?(:assignment_overrides) && input_hash[:assignment_overrides].present?
      if input_hash[:for_checkpoints]
        raise GraphQL::ExecutionError, "Assignment overrides are not allowed in the parent assignment for checkpoints."
      end

      api_proxy.load_root_account
      input_hash[:assignment_overrides].each do |override|
        if override[:id].blank?
          override.delete :id
        else
          override[:id] = GraphQLHelpers.parse_relay_or_legacy_id(override[:id], "AssignmentOverride")
        end
        override[:course_section_id] = GraphQLHelpers.parse_relay_or_legacy_id(override[:section_id], "Section") if override.key?(:section_id) && override[:section_id].present?
        override[:group_id] = GraphQLHelpers.parse_relay_or_legacy_id(override[:group_id], "Group") if override.key?(:group_id) && override[:group_id].present?
        override[:student_ids] = override[:student_ids].map { |id| GraphQLHelpers.parse_relay_or_legacy_id(id, "User") } if override.key?(:student_ids) && override[:student_ids].present?
      end
    end
  end

  def prepare_moderated_grading!(input_hash)
    if input_hash.key? :moderated_grading

View on GitHub (pinned to 1c9f0bb801)