melodyclue
melodyclue
Explore posts from servers
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
@David ok figured out! you're right David. And this issue (invalidate not works) is fully resolved !!! https://trpc.io/docs/client/react/getQueryKeytrpcold
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
@David I think await queryClient.invalidateQueries(getQueryKey(trpc.path.to.query)) is the way how it works on v9 🤔
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
@David oh you are talking about v9. mine is v10 actually...
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
@David so useQueryClient is the key to solve this problrem? I will try !
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
@David 🧐 no, I dont use QueryClientProviders. instead I use export default trpc.withTRPC(App)
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
For now, directly in the function await utils.project.getProject.invalidate({ project_id: projectId }); in the function for example, it seems to be executed.
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
@David In fact, it has not been resolved. It seems that invalidating within onSuccess does not execute. However, there are some that are executed and I am confused.
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
yes I use ``` const utils = trpc.useContext() ... onSuccess() { utils. .... .invalidate() }
22 replies
TtRPC
Created by melodyclue on 7/20/2023 in #❓-help
Sometimes invalidate not work...
well, The problem is solved by writing an invalidate directly after the asynchronous process, instead of "onSuccess". We do not know why "onSuccess" does not work. In some cases it works, so I am confused.
22 replies