Using app queries correctly with modules

I have a main app using a couple queries I need for the integrated module. The only way I managed to get this to work is to take the existing query and "Extract to Query Library", then in the module add a query and "Import from Query Library".

chrome_CRAo3HtddA

This solution works but as the module is in the app it seems inefficient as the query is being called twice.

How would I properly set up the module to "use" the existing query results from the main app?

Hey @Shawn_Optipath, you can pass queries from parent apps to your module.
Modules can trigger the passed queries directly, calling them in event handlers and as success and failure trigger queries, which will also reload the data in the parent app.

Also see: Build modules to reuse queries and components | Retool Docs

Hey @TobiasOhlsson. Thanks for pointing me in the right direction. So in my case in the parent app I have a query getEquipmentType . I need to use the data from this in the module.

In the module I have a checkbox where the data is mapped from the query:
chrome_XkDHnSkfZN

I'm not sure how to set this up:

chrome_CYzeydRTI9

The other thing is the module does not need to trigger the query. I just need access to the data.