Nick
Nick
TtRPC
Created by NotZelda on 3/3/2025 in #❓-help
How to define per route staleTime on queryClient?
Can be passed directly to useQuery and its equivalents
4 replies
TtRPC
Created by xeon06 on 1/10/2023 in #❓-help
input needs to be an object when doing a batch call?
Probably worth opening an issue with a reproduction if you could?
22 replies
TtRPC
Created by Tarky on 2/25/2025 in #❓-help
Catch the error on trycatch and show the message
Do you have an error formatter set up? https://trpc.io/docs/server/error-formatting
3 replies
TtRPC
Created by behaved on 2/25/2025 in #❓-help
operation input is formdata but trpc makes it an application/json POST call
Should work natively with most links (though tell us what link setup you're using as some may not support it)
5 replies
TtRPC
Created by behaved on 2/25/2025 in #❓-help
operation input is formdata but trpc makes it an application/json POST call
Are you set up with that content type as documented here? https://trpc.io/docs/server/validators#non-json-content-types
5 replies
TtRPC
Created by -3est[P]- on 2/25/2025 in #❓-help
v11 with tanstack mutation not invalidate query
Looks like you're using queryKey as the queryKey when queryKey() gives you the query key. I'm surprised TSC doesn't complain about that
5 replies
TtRPC
Created by j on 2/20/2025 in #❓-help
best practice for invalidating protected queries upon profile switch
I would just invalidate everything personally, there's usually little cost to fetching too much and lots of cost to displaying something you shouldn't
3 replies
TtRPC
Created by datagutt on 2/24/2025 in #❓-help
skipToken combined with the new tanstack query options
Will be fixed in the next release
7 replies
TtRPC
Created by datagutt on 2/24/2025 in #❓-help
skipToken combined with the new tanstack query options
Okay I think I've got it, thanks for the report
7 replies
TtRPC
Created by laurence on 2/22/2025 in #❓-help
TRPC not writing to QueryCache?
Could it be you've got multiple QueryClients in your app somehow? tRPC doesn't need a dedicated one, it should be the global one
9 replies
TtRPC
Created by datagutt on 2/24/2025 in #❓-help
skipToken combined with the new tanstack query options
We do have a test around this but I'll flesh it out a little more
7 replies
TtRPC
Created by datagutt on 2/24/2025 in #❓-help
skipToken combined with the new tanstack query options
This might be a bug, skipToken should automatically disable the query I believe
7 replies
TtRPC
Created by David on 2/24/2025 in #❓-help
Should `.queryFilter()` not take a partial arg?
You're correct and this is being fixed in the next release!
3 replies
TtRPC
Created by codecret | Software Engineer on 2/15/2025 in #❓-help
correct way to handle errors run time errors
just use mutate() if you don't intend to handle the error in the callback
7 replies
TtRPC
Created by codecret | Software Engineer on 2/15/2025 in #❓-help
correct way to handle errors run time errors
How are you calling the mutation? I bet you're calling mutateAsync() in a event callback and not catching it, so the console log is correct
7 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
I’ve seen a few situations invalidation can break down but it’s always a legit bug in userland
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
If it doesn’t work it implies some weird timing thing going on with your navigation (try commenting that out)
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
Invalidate doesn’t actually do the refetch, it tells RQ that the query is stale and then RQ will refresh in a new cycle
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
Invalidate is a promise, I’d recommend awaiting it and navigating right after
16 replies
TtRPC
Created by codecret | Software Engineer on 2/13/2025 in #❓-help
invalidate query
That’s a sign something else is wrong, in this case possible onsuccess never fires because you navigate before it has a chance to finish
16 replies