You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not find a way to infer a typescript type from a schema, that I could use elsewhere in my app to help build the correct object to insert in my repository.
Right now this is not built into redis-om.
You can however build your own type to do that mapping which is rather simple but would require wrapping the schema call.
Alternatively if you are interested you can take a look at #188
Hi, thanks for the awesome package,
I could not find a way to infer a typescript type from a schema, that I could use elsewhere in my app to help build the correct object to insert in my repository.
For example considering this schema:
I could totally write the typescript type myself and export it like:
But if I update the schema I have to update the type.
Could we find a way to infer the typescript type from a Schema so its always sync with something like:
This is inspired from the Zod type inference https://zod.dev/?id=type-inference
Thanks :)
The text was updated successfully, but these errors were encountered: