dang
dang
TtRPC
Created by dang on 6/21/2023 in #❓-help
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 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>. This is deprecated in v10, but the call stack 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?
7 replies