Bartholomeas
Bartholomeas
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
@Matvey Sorry for ping but similar question; maybe you know somethinf more? 😄
12 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
i mean there is no way to revalidate single request? 😐 So one awesome function of nextjs is not handled by trpc?
12 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
No description
12 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
Still not :/
12 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
I can do just "router.refresh()" but its kinda... workaround, not solution
12 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
as this satte is kind of dehydrated SSR state so i should be able to refetch that, riht?
12 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
export const PersonalizeText = () => {
const methods = useForm<z.infer<typeof TextElementConfigSchema>>({
defaultValues: DefaultTextElement,
resolver: zodResolver(TextElementConfigSchema),
});

const { getChosenElement, getIsDirty, setStateClear, changeTextElement } = useCardStylesStore();

const utils = api.useUtils();

const { mutate, isLoading } = api.card.updateTextElement.useMutation({
onSuccess: async input => {
setStateClear();
// await utils.card.getBusinessCard.invalidate({
// id: input.id,
// });
await utils.card.invalidate(undefined, { refetchType: "all" });
await utils.card.refetch();

console.log("success..", { input });
},
});
export const PersonalizeText = () => {
const methods = useForm<z.infer<typeof TextElementConfigSchema>>({
defaultValues: DefaultTextElement,
resolver: zodResolver(TextElementConfigSchema),
});

const { getChosenElement, getIsDirty, setStateClear, changeTextElement } = useCardStylesStore();

const utils = api.useUtils();

const { mutate, isLoading } = api.card.updateTextElement.useMutation({
onSuccess: async input => {
setStateClear();
// await utils.card.getBusinessCard.invalidate({
// id: input.id,
// });
await utils.card.invalidate(undefined, { refetchType: "all" });
await utils.card.refetch();

console.log("success..", { input });
},
});
Idk where im getting wrong :/
12 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 11/25/2023 in #questions
Revalidating tRPC server request/page after email change
In typical endpoint it was no problem beacuse i was able to just revalidate specified tag/path :/
4 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 11/21/2023 in #questions
How to invalidate query in T3?
but as i can see i cannot force server TRPC request to refetch? Or ill just need to revalidate the route with nextjs?
13 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 11/21/2023 in #questions
How to invalidate query in T3?
i've send snippet before i started reading. Now i saw that, thanks! cowbiggy
13 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 11/21/2023 in #questions
How to invalidate query in T3?
but i cannot pass any keys or something to useQuery?
13 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 11/21/2023 in #questions
How to invalidate query in T3?
i can use refetch on that
13 replies
TTCTheo's Typesafe Cult
Created by Bartholomeas on 11/21/2023 in #questions
How to invalidate query in T3?
I mean useQuery, wrong snippet, sorry:
const user = api.user.getMe.useQuery();
const user = api.user.getMe.useQuery();
13 replies