Skip to content

Commit 6f039c1

Browse files
authored
docs: add note on transformations registration (#10523)
add note on transformations registration
1 parent f36a93a commit 6f039c1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

guides/the-manual/schemas/transformations.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,17 @@ user.netWorth = 2_500_000.005;
115115

116116
The `type` field in the schema entry matches the `[Type]` symbol on the transformation object — just as with derivations.
117117

118+
::: tip Registering without `useRecommendedStore`
119+
If you're not using `useRecommendedStore`, register transformations imperatively before any schema that references them is registered:
120+
121+
```ts
122+
import { PriceTransform } from './transformations/price';
123+
store.schema.registerTransformation(PriceTransform);
124+
```
125+
126+
See [`SchemaService.registerTransformation`](https://api.warp-drive.io/interfaces/SchemaService.html#registertransformation) in the API reference.
127+
:::
128+
118129
## Two-Way Conversion
119130

120131
The full round-trip for a transformed field:

0 commit comments

Comments
 (0)