The query widget, filter widget and search widget all seem to query from one layer. Is there a widget that can query multiple layers at the same time? There seems to be nothing.
I'm assuming you're using experience builder. There is not a purpose built widget that does multi layer filtering like there was in web app builder. A number of other folks have also run into this issue and discussed various workarounds in the threads below:
There is also an idea for the functionality that you can up vote:
https://community.esri.com/t5/arcgis-experience-builder-ideas/group-filter-widget/idc-p/1338214