# Bug OP-18082 - APIv3: Missing eager load in /api/v3/projects

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-18082

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | API |
| Target versions | 16.6.0 |
| Observed in versions | 16.5.0 |
| Sprint | 16.6.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.5.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Jan Sandbrink |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Be on an OpenProject instance with a large amount of projects, of which many are in a parent-child relation
    
2.  Call `/api/v3/projects`
    
3.  Watch the Active Record server logs
    

### What is the buggy behavior?

An N+1 query on the projects table is happening, slowing down the response.

### What is the expected behavior?

No N+1 query.
