Query keeps getting triggered
Hi there, I am using a query in my
beforeload function in my router. It's a function that fetches the user session, but I have an issue, that it seems that whenever I navigate anywhere on my app, the function gets called every time, sometimes multiple times:
This is my implementation, do I need to add more properties? I sent a screenshot of my terminal it just shows a bunch of calls from me just hovering over a link few times

2 Replies
foreign-sapphire•8mo ago
beforeLoad runs in serial whearas the loaders all run in parallel, which is why anything that does a fetch usual goes in loader
I'd say if you use ensureQueryData that'll cut down on the fetchesequal-jadeOP•8mo ago
Awesome thanks