Optimize `recentMilestones` field in `RepositoryNode`
- Dominant language
- Python
- Stars
- 451
- Forks
- 707
- Avg merge
- 22h 59m
- Merged PRs (30d)
- 91
Description
**Is your feature request related to a problem? Please describe.**
When querying the recentMilestones field, we get N+1 queries.
**Describe the solution you'd like**
The current optimization hint is not enough for optimizing the query. We should use Prefetch instead.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Are you going to work on implementing this?**
- [ ] Yes
- [x] No
**Additional context**
https://strawberry.rocks/docs/django/guide/optimizer#optimization-hints
Contributor guide
Research direction
Start by locating RepositoryNode and its recentMilestones field, then read the linked Strawberry Django optimizer guidance on Prefetch. Verify the change removes the N+1 queries when recentMilestones is queried and preserves the field's results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100