Hi ebachilo,
If you would like to use code to develop a Query widget for your web appBuilder application, you may need to think about converting your web appBuilder app to Experience Builder app first and then develop the widget for your Experience Builder app. Because web appBuilder will retire soon and it will waste your time to develop a widget for it.
If your question means that you will use the build-in Query Widget / Search Widget of Web appBuilder to quickly implement something, you can go ahead to config a Query Widget.