-
Goal: I want a query to consistently execute on page load. It is NOT executing when switching between Retool pages. It is mostly only working after a full page reload.
-
Steps: I have a page where I load Customer Data. It uses a GQL query to ping my server and request user details. There's a GQL query called
GetUserById
which I've already set to run on Page Load with no delay. This query was working intermittently (it would run on page load sometimes, but not consistently). It seems like whenever I navigate from one Retool page to another, the query does NOT work. But when I hard reload, it does run. So as an attempt to fix this, I created a script which runs on page load, which CALLS the same GQL query. You can see that script in the beginning of the video.
View Customer.json (647.9 KB) -
Screenshots: Video of behavior here. You can see when I first start the app and move between two pages, the query works fine. Then, when I try it a second time, it does NOT work. There is functionally no difference between the two page loads, there is no caching, etc. It should work, but it doesn't: On-Page Load Retool Query Fails
-
[App json export] Provided below
Hey @dzd - thanks for reaching out!
I'm not able to replicate the full complexity of your app due to its reliance on external resources, which might be why I also don't see the same issue. The GetUserById
query seems to be triggering reliably when I switch between apps using the utils.openApp
function. For the purposes of debugging, I do recommend looking at the "Timeline" tab in order to better visualize which queries are executing at different points in time.
I will do some additional digging to see if I can figure out what is happening here, but in the longer term definitely recommend rebuilding this as a true multipage app! The feature is currently in private beta but comes with some serious performance gains and, hopefully, more reliable query triggering.