Modules: suppress errors about unset input queries?

I'm writing a module, and I have a query input called OnSuccessRun. In the dummy OnSuccessRun query Retool creates, I've turned off "Show notification on failure". However, when my module triggers that query, if the host app hasn't set it to anything or I'm testing the module alone, I get an error banner about how OnSuccessRun isn't set to a query.

As a workaround, I created an IfOnSuccessRun JS query wrapper for my module to call on success:

OnSuccessRun.query && OnSuccessRun.trigger();

Is this a platform bug? When I have the dummy query's "Show notification on failure" turned off, should it still be showing a notification about how the query's not set to anything?

1 Like

Hey geometric, thanks for bringing this up! This isn't a platform bug, but I can see how this could be a bit confusing. The error message you're seeing isn't a notification being shown as a result of the query failing. The error message shown is a frontend error caused by trying to trigger a query that isn't defined. I hope that helps clean up any confusion here!

Thanks for clarifying.

For convenience, when writing a module with input queries that the host app might not need, it would be convenient if I could designate those inputs as optional or otherwise suppress errors when triggering unset input queries. There are lots of nice editor UI elements that let you choose a query to trigger on some event, and it would be nice to be able to use those instead of writing null-check Javascript shims for each input query.

But, knowing this behavior is intended, null-check shims are a reasonable workaround for my project.

1 Like