chore: address #2102 by adding mention of Unwrap (#2110)

This commit is contained in:
Christopher Schmitt
2021-11-05 02:08:39 -06:00
committed by GitHub
parent dffc12d44a
commit 657c5c7bad

View File

@@ -58,6 +58,8 @@ func rollback(tx *ent.Tx, err error) error {
}
```
You must call `Unwrap()` if you are querying edges off of a created entity after a successful transaction (example: `a8m.QueryGroups()`). Unwrap restores the state of the underlying client embedded within the entity to a non-transactable version.
The full example exists in [GitHub](https://github.com/ent/ent/tree/master/examples/traversal).
## Transactional Client