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 load ListPostsController needed relations #2717

Merged
merged 2 commits into from
Mar 22, 2021

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Mar 20, 2021

Part of #2637

Changes proposed in this pull request:
Eager loads the discussion and user.groups relations, leaving discussion.tags and mentionedBy relations until there is a mechanism for extensions to specify needed relations to be eager loaded (which I'll push after this).

Reviewers should focus on:
You can test this by hitting the /api/posts?page[offset]=0&page[limit]=50&include=user endpoint.

Screenshot
flarum lan___clockwork_app (1)
flarum lan___clockwork_app (2)

Confirmed

  • Backend changes: tests are green (run composer test).

@SychO9
Copy link
Member Author

SychO9 commented Mar 20, 2021

actually, don't merge this yet, I'd like to confirm that these relations are not only needed by specific extensions.

@SychO9 SychO9 merged commit 3cc18c1 into master Mar 22, 2021
@SychO9 SychO9 deleted the sm/2637-nplusone-queries-posts branch March 22, 2021 08:54
@SychO9 SychO9 mentioned this pull request Mar 25, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants