-
Notifications
You must be signed in to change notification settings - Fork 362
Description
I found a typo in the documentation for the new defineRelationsPart API (specifically in the "Relations Parts" / "Rule 1" section).
In the explanation of why the order matters, the documentation currently repeats the same code snippet for both the "correct" and "incorrect" scenarios.
The Issue
The text states:
Having { ...relations, ...part } will result in [...]
and having { ...relations, ...part } will result in [...]
The second instance repeats the first one, making it impossible to see the difference in the resulting object structure.
Suggested Fix
- The second sentence should demonstrate the inverse order to match the context of the warning:
and having { ...part, ...relations } will result in [...]
Reasoning
The documentation is trying to explain that defineRelations creates empty placeholders (e.g., posts: {}) for all tables. If relations (the main object) is spread last, its empty placeholders overwrite the actual relation definitions defined in part. The current text fails to illustrate this because it uses the "correct" spread order (...relations, ...part) in the "incorrect" example text.