tRPCttRPC
Powered by
toadmilkT
tRPC•2y ago•
3 replies
toadmilk

how are you meant to set up client side queries?

why is there no type on the data? don't know what to do about the deprecated
onSuccess
onSuccess
stuff either.

  trpc.authCallback.useQuery(undefined, {
    onSuccess: ({success}) => {
      if (success) {
        router.push(origin ? `/${origin}` : '/dashboard');
      }
    },
    onError: (err) => {
      if (err.data?.code === 'UNAUTHORIZED') {
        router.push('/sign-in');
      }
    },
  trpc.authCallback.useQuery(undefined, {
    onSuccess: ({success}) => {
      if (success) {
        router.push(origin ? `/${origin}` : '/dashboard');
      }
    },
    onError: (err) => {
      if (err.data?.code === 'UNAUTHORIZED') {
        router.push('/sign-in');
      }
    },


Would really appreciate if someone could help me out 🙏
image.png
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

Unable to set up a client side subscription to a trpc route that supports websockets
OtterSwims996OOtterSwims996 / ❓-help
3y ago
How to access TRPCClientError error path client-side?
Answer OverflowAAnswer Overflow / ❓-help
15mo ago
how to set request timeout in client
backboneBbackbone / ❓-help
3y ago