#tRPC + Tanstackk Query Wrapper

5 messages · Page 1 of 1 (latest)

vast raft
#

Does anyone have an example of a wrapper function / hook that returns hooks for mutations and queries? I'm thinking something similar to RTK where you can use the createApi function and inject endpoint, then return useThisMutation useThisQuery. It'd be nice to have a single file for each trpc router that calls the tanstack useQuery or useMutation, queryKeys defined in that same file also, not have to call the useTRPC and useQueryClient hooks in every component that makes a network request

signal falcon
#

I see he builds pretty well, but hasn't switched to using the alpha branch yet.

vast raft
#

Oh yeah, that's a method I was starting to implement. I guess I was on the right path