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

not found

Error message

not found

What it means

The updateGradebookGroupFilter mutation rescues ActiveRecord::RecordNotFound from its service call and re-raises it as a GraphQL::ExecutionError with message "not found". It means the gradebook group filter (or the group the filter points at) referenced in the input could not be loaded by the update logic.

Solutions

  1. Reload the gradebook filter/group list via the API to confirm the id still exists before mutating.
  2. Verify the id belongs to the course/account context the request is made in.
  3. Confirm the user has permission to see the group; scoping to grants can make records invisible.
  4. Handle the GraphQL errors entry in the client and refresh gradebook settings state.
Defensive patterns

Strategy: validation

Validate before calling

// confirm the filter/group still exists before mutating
const filters = await fetchGradebookFilters(courseId)
if (!filters.groups.some(g => g.id === groupId)) throw new Error('group not found')

Try / catch

try {
  await updateGradebookGroupFilter(input)
} catch (e) {
  if (e.graphQLErrors?.some(g => g.message === 'not found')) {
    await refreshGradebookSettings()
  } else { throw e }
}

Prevention

When it happens

Trigger: Calling updateGradebookGroupFilter with a filter/group id that does not exist, was deleted, or belongs to another course/account so the scoped lookup inside the update service returns nil.

Common situations: Two users in the same course where one deletes a group while another still has it open; stale client state after gradebook customization changes; passing a wrong id type to the Relay id prepare function.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/update_gradebook_group_filter.rb:55

    group_selection = SpeedGrader::StudentGroupSelection.new(current_user:, course:)
    updated_group_info = group_selection.select_group(student_id:)
    if updated_group_info[:group] != group_selection.initial_group
      new_group_id = updated_group_info[:group].present? ? updated_group_info[:group].id.to_s : nil
      context_settings = current_user.get_preference(:gradebook_settings, course.global_id) || {}
      context_settings.deep_merge!({
                                     "filter_rows_by" => {
                                       "student_group_ids" => new_group_id.present? ? [new_group_id] : []
                                     }
                                   })
      current_user.set_preference(:gradebook_settings, course.global_id, context_settings)
    end
    {
      group_name: updated_group_info[:group]&.name,
      reason_for_change: updated_group_info[:reason_for_change],
    }
  rescue ActiveRecord::RecordNotFound
    raise GraphQL::ExecutionError, "not found"
  end
end

View on GitHub (pinned to 1c9f0bb801)