Option to Disable all queries in a Module from Parent app

I have wanted this feature for a while but this post crystalized my ask: Why does Retool runs all queries inside a model, regardless if they have a disable flag?

I often put a module in a modal or otherwise hidden until the user needs to interact with it. If the user never interacts with the module, then any queries it runs affect performance. Especially if it is tied to a table's selected row or other case that causes it to constantly requery. There may be other use cases where even if the module is visible, you do not want to run it's queries until a particular condition exists.

I have gotten around this by setting all module queries to be disabled if a flag, passed in through an input, is not set.

What I would like is a module setting, that if set to false, disables all queries in the module. Another option is to disable all queries for a module that is not currently painted. Those two would give us a bunch of options.

I would also want this property to be visible to the module itself in case it has other nested modules to pass this property on to.

4 Likes

+1, I use the module today, and want to find the same feature to disable query when module is hidden.

I wholeheartedly concur with your points! This is indeed significant and deserves more immediate attention from the Retool team. :wave:

This would be great. I use the same work around but it adds a lot of overhead to make sure everything is controlled by the input.

This feature would be great - a simple option on the module to run module queries only when the module is displayed, rather than run on page load would make things a lot easier.

I use a similar workaround also, but Duncan isn't wrong in saying that the overhead is a lot, and sometimes annoying to work out the logic in the parent app to set this input true/false when required in different scenarios.

Thanks for all your interest! We're logging each user's interest from comments here onto the internal feature request as a +1, so the team has visibility on your comments :slight_smile:

I hear you that current workarounds require a lot of overhead. We'll update here when there's movement toward implementing this.

+1 to this request. In addition I'm finding that modules inside a modal or a drawer frame experiences additional lag when interacting with components (selecting or entering inputs).