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 know this topic has been raised many times (here, here, here, etc.). Still not sure why it's a bad idea, but I'd like to present a usecase where (to my knowledge) there is no workaround:
Using zod for output validation with libraries like orpc / trpc
Using async transforms to resolve ids by fetching them in a database
Using dataloaders to avoid the N+1 query problem
The point of dataloaders is to batch async calls to the db. They would need to be recreated for every request and passed down to transforms as context.
Is there a known workaround for this usecase?
Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I know this topic has been raised many times (here, here, here, etc.). Still not sure why it's a bad idea, but I'd like to present a usecase where (to my knowledge) there is no workaround:
The point of dataloaders is to batch async calls to the db. They would need to be recreated for every request and passed down to transforms as context.
Is there a known workaround for this usecase?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions