Avraj
Avraj
Explore posts from servers
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
i believe that solves the issue for me
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
i think for now i'll disable refetchOnWindowFocus. in case i find a reason for it to be enabled i'll have to do a little more research on using the queryClient xD
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
it would be nice to have that, but if i can keep that turned off i believe that fixes the issue right? tRPC doesn't send any other requests automatically i'm guessing?
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
because the state still hasn't changed back to false
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
you're definitely right there, but there is still an issue of requests sent on behalf of tRPC when focusing on the window. i like that feature but when focusing back on the window it'll send new requests. but now it'll send with skipCache set to true
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
changing it back to false at the end of the handleRefresh function doesn't seem to do anything either because of how react handles state changes
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
alright so i've tried this approach too and there is one slight issue. let me explain. everything works well until the handleRefresh function has stopped calling. say the user wants to refresh the list of guilds once again. the skipCache state is now stuck at true and handleRefresh won't do anything anymore when called
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
imagine a discord bot dashboard where you have a list of servers once a user is in this page, say they create a new server in discord but now that server is not part of the list in the web app because it's still using the cache which will last another 15 mins the refresh button will give them the option to fetch the latest array of servers
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
when the page is first loaded, the data that is fetched should be from the cache (if it's available in the server). but the user will now have the chance to fetch the latest data by clicking a button. this button is supposed to invalidate the cache in the server and return the most up to date data
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
the other way around actually
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
but that leads to 2 routes doing almost the same thing. they'll both return the same data, but one does with cache and one without
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
i was thinking of maybe creating a new route in my server to invalidate the cache and return new data
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
so i've used invalidation before, but the reason it doesn't work in my case is that it uses the same query details to make another request to the server. there's no way for me to explicitly state in the invalidation that this specific request is supposed to have a new set of parameters.
29 replies
TtRPC
Created by Avraj on 1/23/2024 in #❓-help
Is there a way to refetch a query with new parameters?
thanks i've tried this before, but such is the feature. if a user wants the latest data it makes for bad ux to make them wait a certain time. also as mentioned it's an expensive query so it should only be done every now and then, which is why the cache i have on the server lasts 15 mins. is there no workaround at all for this?
29 replies