I believe if you toggle this feature in the Advanced tab of JS queries, this should work as intended: