If you had already publish the module with the query in place, just use the option "Compare and merge with another version or file",
- choose the version with the query
- Find the query in the right of the popup
- Copy ( select and Ctrl C) the query
Close the opup
And beck in the in your action Paste the query.
Regards , hope this helps
Graça