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 tags relation in discussion, posts and flags listing endpoints #125

Merged
merged 2 commits into from
Mar 25, 2021

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Mar 21, 2021

Part of flarum/framework#2637
Works with flarum/framework#2724

When discussions are loaded, the tags relationship is always needed, because the DiscussionPolicy accesses said relation.
The key difference to note here between including relationships and eager loading them, is that just because we eager load it doesn't mean it will be included in the JSON response, the response always included relationships explicitly included in the request.

@SychO9 SychO9 mentioned this pull request Mar 25, 2021
13 tasks
@SychO9 SychO9 merged commit 8538222 into master Mar 25, 2021
@SychO9 SychO9 deleted the sm/nplus-one-queries branch March 25, 2021 14:37
askvortsov1 pushed a commit that referenced this pull request Mar 11, 2022
…ints (#125)

* Eager load tags relation when listing posts & discussions
* Eager load ListFlags post.discussion.tags relation
askvortsov1 pushed a commit that referenced this pull request May 10, 2022
…ints (#125)

* Eager load tags relation when listing posts & discussions
* Eager load ListFlags post.discussion.tags relation
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