tRPCttRPC
Powered by
dangD
tRPC•3y ago•
6 replies
dang

Migrating v9 to v10 - - using the client?

I'm migrating a large project from trpc v9 to v10. There is a section of the code that uses the result of
trpc.useContext().client
trpc.useContext().client
to perform several mutations. For example:

const addMeasurementPromise = client.mutation('measurements.add', { ...data})
const addMeasurementPromise = client.mutation('measurements.add', { ...data})


In v9, the type of the client was
TRPCClient<AppRouter>
TRPCClient<AppRouter>
. This is deprecated in v10, but the call stack
createTRPCNext -> createFlatProxy -> createReactQueryUtilsProxy -> createTRPCProxyClient
createTRPCNext -> createFlatProxy -> createReactQueryUtilsProxy -> createTRPCProxyClient
appears to still use this type.

Is there a replacement type that I should be using instead? Is this pattern fully deprecated within trpc v10, or is there a supported path to creating a mutation that isn't encapsulated in a hook?
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Migrating to V10 from V9
WezterWWezter / ❓-help
4y ago