Open SychO9 opened 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!
Split off from flarum/framework#2637
This is when hitting the endpoint
/api/notifications?page[offset]=0&page[limit]=50&include=subject
(extreme to be able to properly see uneager loaded relations).There is improvement to be made, the difference between this endpoint and the others, is that the N+1 queries are mainly coming from the
subject
polymorphic relationship, for examplesubject.tags
orsubject.discussion.tags
. Best way to go about it is to provide aloadMorph
method to the ApiController extender to allow extensions (such as tags) to eager load the relations necessary.