Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eager loading in notifications endpoint #113

Open
SychO9 opened this issue Apr 7, 2021 · 1 comment
Open

Eager loading in notifications endpoint #113

SychO9 opened this issue Apr 7, 2021 · 1 comment
Labels

Comments

@SychO9
Copy link
Member

SychO9 commented Apr 7, 2021

Split off from flarum/framework#2637

flarum lan___clockwork_app (9)

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 example subject.tags or subject.discussion.tags. Best way to go about it is to provide a loadMorph method to the ApiController extender to allow extensions (such as tags) to eager load the relations necessary.

@SychO9 SychO9 mentioned this issue Apr 7, 2021
13 tasks
@stale
Copy link

stale bot commented Jul 8, 2021

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!

@SychO9 SychO9 added the org/keep label Jul 8, 2021
@askvortsov1 askvortsov1 transferred this issue from flarum/framework Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant