Child module not triggring the GraphQL query on second load

I have a module, and I'm using it inside another app. The parent app's default behaviour is that when it clicks on a cell in a table, it calls the module by the cell ID. The Module uses this ID internally to call a GraphQL query and load the data.

This process works fine, but if the user clicks a second time on the same cell after closing the popup (where the module is present), the module does not trigger the GraphQL query. But it works fine if the user clicks on any other cell (which means the ID was changed).

I don't know if the default behaviour of Retool is where the parameters to the module are the same, then don't reload the data or if there is something else I'm missing.

Also, I'm not using Retool Cache, so it is not a caching issue.

Hi @TabraizAhmed,

So to confirm, clicking the cell in the table opens the popup which holds the module. And then passes the ID to the module where the query is run. Which works.

But, after the popup is closed, when the same cell is clicked again, the popup does not open with the module and the query does not run.

But, after closing the popup, if a different cell is clicked, then a popup does open and the module runs the query correctly?

Is the popup a modal? You should be able to run the same query with the same unchanged parameters/ID.

What is triggering the GraphQL query? This may be due to the module not receiving the ID the second time the cell is clicked. You may need to console log the input of the modal to check and see if the ID is being passed in a second time.

If the GraphQL query is set to be triggered when the popup/module opens and is not running then we may need to look elsewhere to debug. In which case I would recommend trying the same architecture but without a module in the popup and see if you can re-run the query with just components in the popup and the GraphQL query in the app.

Hi @TabraizAhmed,

Just wanted to check in to see if you are still experiencing this query not firing when expected or if you found a work around.

We may need to live debug this in office hours, since it sounds like a complex set up where the other cells work fine, but something needs to be 'reset' to get the same cell to work when the same click is repeated :thinking: