tRPCttRPC
Powered by
RyanR
tRPC•3y ago•
8 replies
Ryan

Modify the payload before mutating

I have a specific mutation hook that is used all throughout my app, and inside of the hook I want to modify the payload before it is sent to the server (to read something from local storage and add it to payload). Is this possible? I can't seem to find a way to do this. There also isn't a way AFAIK to modify the mutationFn with the nextjs adapter.

My only solution would be redefining mutate and mutateAsync that are modified to do this preprocessing.

Thanks!
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Modifying payload client-side before caching
pbeshPpbesh / ❓-help
4y ago
Modify mutation error messages?
Jack FischerJJack Fischer / ❓-help
3y ago
Correct types and payload for the applyWSSHandler with createContext
renardeinsRrenardeins / ❓-help
2y ago
How to limit payload size?
aryzingAaryzing / ❓-help
3y ago