Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
18 replies
zilahir

ct3a with `react-query`

Hi! I am messing around with ct3a, and honeslty it's pretty good. Trpc is great, react-query is great, but even though I've read the docs, I am not sure how to call trpc procudere with react-query.

I've been trying whats in the docs also:

const thisUser = await api.user.getUser.useQuery()


but seems like the
useQuery
is not exists on the type:

Property 'useQuery' does not exist on type '{ query: Resolver<BuildProcedure....


the API looks like this:

export const userRouter = createTRPCRouter({
    getUser: protectedProcedure.query(({ ctx }) => ({
        ...ctx.session.user
    }))
})


I am pretty sure I am missing something, but i am not sure what.

Any help would be appricaited! 🙂 Thakn you!
Was this page helpful?