Skip to content

docs(api): load a relationship in full with withoutRelatedScope() - #679

Merged
imorland merged 1 commit into
mainfrom
im/without-related-scope
Oct 17, 2026
Merged

imorland merged 1 commit into
mainfrom
im/without-related-scope

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes: no issue.

Changes proposed in this pull request:
From 2.0.2, a relationship field can call withoutRelatedScope() so that endpoints eager load it in full rather than through the related resource's scope (flarum/framework#5241). The API page gains a "Loading a relationship in full" section under Relationships: when to use it (a relation that policies read, such as a user's groups), and that the field's getter must then leave out what the actor may not see.

Reviewers should focus on:

Screenshot
N/A, text only.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered? (N/A)
  • For core PRs, does this need to be in core, or could it be in an extension? (N/A, docs.)
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation. (No code changes.)
  • Frontend changes: tests are green (run yarn test in js/). (No code changes.)
  • Frontend changes: tests have been added, or are not appropriate here. (No code changes.)
  • Backend changes: tests are green (run composer test). (No code changes.)
  • Backend changes: tests have been added, or are not appropriate here. (No code changes.)
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite). (N/A)
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

@imorland
imorland merged commit 6a5309a into main Oct 17, 2026
6 checks passed
@imorland
imorland deleted the im/without-related-scope branch October 17, 2026 21:12
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.

1 participant