Add possibility to provide schema using Promises #151
Closed
ShockOfficial
started this conversation in
Ideas
Replies: 1 comment
-
Check out #111, thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Something that really bothers me is that there is no way to provide schema asynchronously.
In the project, I am using
next-intl
withzod
to give error messages in the appropriate language so basically the way to do that is to provide the translation function while creating the schemaOn the server side, there is async
getTranslations()
function that can be used to get translations but theschema()
can't handle Promises.Something that I would appreciate is to have an interface for schema that accepts and handles Promise or other way to provide schema later on using maybe middleware with
use
and passing schema throughctx
that would be typesafeMy current approach works but is not ideal since this is not type-safe on the client side.
If there is no quick fix let me know. Will try to refactor the way I create schema with translations.
Beta Was this translation helpful? Give feedback.
All reactions