Avoid N+1 queries in API endpoints wherever IssueBasic or MergeRequestBasic are used
Follow up on issue !24974 (merged)
I also noticed that issuable_metadata
is only available for some API endpoints that return issues like GET /issues
and GET /projects/:id/issues
, etc..
There are other API endpoints that use IssueBasic
and MergeRequestBasic
(which also uses issuable_metadata
). For those endpoints, there will be N + 1 queries for downvotes
, upvotes
and merge_requests_count
. An example is: /projects/:id/milestones/:milestone_id/issues