drizzle-team / drizzle-team/drizzle-orm-docs

Typo in defineRelationsPart docs: Incorrect spread syntax in explanation

Open
#629 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
241
Forks
401
Avg merge
5h 44m
Merged PRs (30d)
1

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.